angularjs – angular-ui:使用popover-template

前端之家收集整理的这篇文章主要介绍了angularjs – angular-ui:使用popover-template前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我发布了一个早先的问题: angular-ui-bootstrap: Implementing html in popover using popover-html,有人建议我使用popover-template.

<i popover-template="popover-partial.html" popover-title="In Progress" class="glyphicon glyphicon-info-sign"></i>

<script type="text/ng-template" id="popover-partial.html">
    <b>Jody</b>
</script>

所以我试图这样做,但现在弹出窗口不会在点击时激活.

我使用的是版本0.13.4.

解决方法

popover-template值应该是string,换句话说你可以这么说,它需要一个表达式/ scopeVariable.

<i popover-template="'popover-partial.html'" 
  popover-title="In Progress" 
  class="glyphicon glyphicon-info-sign">
</i>

Demo

猜你在找的Angularjs相关文章