簡體   English   中英

Angular-UI引導程序不適用於模板

[英]Angular-ui bootstrap don't work correctly with templates

我使用angular-ui-bootstrap popover。 我手動更改了popover模板以在其中支持html。 我將ng-bind更改為ng-bind-html:

<div class=\\"popover-content\\" ng-bind-html=\\"content\\"></div>

我正在將這樣的模板傳遞給popover屬性:

<span ng-click="scopeFunction()">{{somethingFromScope}}</span>

因此{{somethingFromScope}}可以解決並起作用,但是ng-click函數不起作用。 ng-showng-if (看起來像任何ng-指令)都無法正常工作。

是什么原因呢? 我該如何運作? 謝謝

僅更改模板是不夠的

像這樣更新模塊依賴性:

  angular.module('ui.bootstrap.popover', ['ui.bootstrap.tooltip', 'ui.bootstrap.bindHtml'])

並更改模板

  <div class="popover-content" bind-html-unsafe="content"></div>

從2014-05-01開始與angular.ui.bootstrap v0.11.0一起使用

經過大量研究后,我找到了解決方案:

如果您需要帶有模板的彈出窗口-請使用AngularStrap popover;)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM