0
이 바이올린 링크로 부트 스트랩 팝 오버를 사용 중입니다. http://jsfiddle.net/ivankovachev/U4GLT/AngulatJS를 사용하여 부트 스트랩 popover를 어떻게 사라지나요?
팝업이 올 텍스트를 클릭하면 작동합니다. 두 번째 클릭에서 사라집니다 (전환). 괜찮아.
이제 페이지에서 다른 위치를 클릭 할 때 토글 링을 포함한 나의 요구 사항이 사라집니다.
나는 노력하고있다. 제발 저를 도와주세요. 당신은 event.stopPropagation 기능 여기
을 사용할 수 있습니다
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