我正在嘗試創建一個彈出指令。ui.bootstrap-directrive與uib-popover-html不起作用
我想爲此使用ui.bootstrap。不幸的是它不顯示任何東西。 以下是帶示例的plunker。
<div>
Popover uib (notworking- uib-popover-html) ->
<div mydirectiveuib ng-model="name"></div>
</div>
app.directive('mydirectiveuib', function(){
return{
restrict: 'EA',
replace: true,
scope: {
ngModel: '='
},
template: ' <span class="test">aaa<img popover-trigger="mouseenter" popover-placement="right" uib-popover-html="<h2>{{ngModel}}</h2>" width="20" height="20" src="http://icons.iconarchive.com/icons/dakirby309/windows-8-metro/48/Folders-OS-Info-Metro-icon.png" alt="info icon" /></span>',
link: function(scope, iElement, iAttrs) {
}
};
})
如果我改變UIB-酥料餅,HTML只酥料餅這是工作。
<div>
Popover (working) ->
<div mydirective ng-model="name"></div>
</div>
app.directive('mydirective', function(){
return{
restrict: 'EA',
replace: true,
scope: {
ngModel: '='
},
template: ' <span class="test">aaa<img popover-trigger="mouseenter" popover-placement="right" popover="<h2>{{ngModel}}</h2>" width="20" height="20" src="http://icons.iconarchive.com/icons/dakirby309/windows-8-metro/48/Folders-OS-Info-Metro-icon.png" alt="info icon" /></span>',
link: function(scope, iElement, iAttrs) {
}
};
})
任何想法我做錯了什麼,如何解決它?
它不適合我。這裏是plunker - http://plnkr.co/edit/dLBgL9WBxevYqCbnGl2b?p=preview – Kosmonaft
它甚至不能使用文檔中的演示代碼:https://plnkr.co/edit/7o7OBnqxFqxl2eGTefcU?p=preview – neridaj
這裏是一個與0.14.3一起工作的例子,它接近文檔的演示。 https://plnkr.co/edit/6MwtASS0oR69XDh9OHun?p=preview – AdamExchange