0
我使用的引导酥料饼通过此链接小提琴http://jsfiddle.net/ivankovachev/U4GLT/如何使用AngulatJS消除Bootstrap popover?
它的工作,当我点击酥料饼快到文本。在第二次点击它正在消失(切换)。没关系。
现在,我的要求包括切换,当我点击页面中的任何其他地方,然后弹出应该消失。
我在努力。请帮我做到这一点。
customDirectives = angular.module('customDirectives', []);
customDirectives.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
});
}
};
});
angular.module('CustomComponents', ['customDirectives']);
你,它的工作,但是否有任何其他的方式,而不使用$(窗口) –
你可以使用http://www.markschabacker.com/blog/2014/12/26/angular-any-other-click/这个aproach如果你想 – SuperComupter