我正在尝试创建一个弹出指令。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