【发布时间】:2016-06-06 08:54:28
【问题描述】:
我是 Angular 的新手。我已经使用 angular ui.bootstrap 创建了一个模态。我有一个带有外部链接的锚标签。如果我单击锚标记,则新窗口不会打开。任何 preventDefault 都应用于模态?
$uibModalInstance = $uibModal.open({
animation: true,
template: '<div class="modal-header "><h3 class="modal-title">{{modalTitle}}<a href="javascript:void(0);" class="icon icon-page_close_grey" ng-click="cancel()"></a></h3></div>' +
'<div class="modal-body">' + data + '</div><div class="modal-footer"></div>',
size: 'lg',
backdrop:'static',
controller: modalcontroller
});
这里我的数据包含一个带有 href="http://www.google.com" , target="_blank" 的标签。有没有人可以帮忙
【问题讨论】:
-
使用
ng-bid-html将锚标记插入div.modal-body。