3
안녕하세요 저는 부트 스트랩과 angularjs를 사용하여 popover를 성공적으로 생성했습니다. 하지만 동시에 내가 닫기 버튼을 눌렀을 때 팝업 창이 닫히고 (숨김) 다음 번에 다시 시작하려면 링크 또는 아이콘을 두 번 클릭해야하는 문제가 있습니다. 팝 오버의AngularJS Bootstrap 닫기 버튼 활성화 문제가있는 Popover
샘플 그림 - 많은 연구 후 http://i62.tinypic.com/2uzufkz.png
<a href="#" custom-popover popover-title="Hello">Please click Me !!! </a>
define(['ngApplication'],function(app){
app.directive('customPopover',['$compile',function($compile){
var templateData = "<a> {{tooltiplabel}} </a><button>x</button>";
return {
restrict: 'A',
transclude: true,
template: "<span ng-transclude></span>",
link: function(scope,element,attribute,controller){
var compliedData = $compile(templateData)(scope);
// Tried with Remove
//var getTitle = "<span>"+attribute.popoverTitle+"</span><button id='btnClose' type='button' class='close' onclick='$(".popover").prev().removeAttr("aria-describedby"); $(".popover").remove();'>×</button>";
// Tried with hide
var getTitle = "<span>"+attribute.popoverTitle+"</span><button id='btnClose' type='button' class='close' onclick='$(".popover").hide();'>×</button>";
var proc = $compile(getTitle)(scope);
$(element).popover({
'placement': 'top',
'html': true,
'title': proc,
'content' : compliedData
});
}
};
}]);
});
내가 사용하는 것이 좋습니다 [각도 UI 부트 스트랩 (http://angular-ui.github.io/bootstrap/) 대신 부트 스트랩의 jQuery 플러그인. – cvrebert
Angular UI bootsrap을 사용했지만 그 안에 닫기 버튼 기능을 구현할 수 없습니다. 각도 UI를 사용하여 이것을 달성 할 수있는 방법을 알려주십시오. – Keysinnovation
AngularUI 부트 스트랩을 더 좋아하지만, 바닐라 부트 스트랩보다 사용자 정의하기가 더 어렵습니다. – UltraSonja