【发布时间】:2014-04-08 12:41:21
【问题描述】:
我正在使用 Angular UI Bootstrap 弹出框。我不想给出文本,而是从 Div 或 html 模板加载弹出框内容。这是我正在使用的示例指令
app.directive('customPopover', function () {
return {
restrict: 'A',
template: '<span>{{label}}</span>',
link: function (scope, el, attrs) {
scope.label = attrs.popoverLabel;
$(el).popover({
trigger: 'click',
html: true,
content: attrs.popoverHtml,
placement: attrs.popoverPlacement
});
}
};
});
<button popover-placement="bottom" **popover**="On the Bottom!" class="btn btn-default">Bottom</button>
如何从 Div 或任何 HTML 模板中获取自定义文本?
【问题讨论】:
标签: angularjs