【问题标题】:Can angular ui popover title be an angular expressionangular ui popover title可以是角度表达式吗
【发布时间】:2015-09-22 20:51:24
【问题描述】:

我无法将 popover-html 设置为角度表达式。

例如 角度标记

<script type="text/ng-template" id="something.html">
   <button>dummy</button>
</script>
<button popover-is-open="sm.isOpen" 
popover-template="'something.html'" 
popover-placement="top" popover-title="sm.popoverTitle"/>

控制器代码

 function activate(){
      $scope.sm={};
      $scope.sm.isOpen=true;
      $scope.sm.popoverTitle=" Functionality  <button>close</button>";
 }
 activate();

弹出框标题呈现为“sm.popoverTitle”,而不是我指定的 html 标记。

我正在使用 Angular UI Bootstrap 版本 0.13.4

【问题讨论】:

  • 你试过用括号括起来吗? {{sm.popoverTitle}}
  • 你真是个该死的天才!!!请添加为答案,以便我接受。这东西太乱了。 popover-is-open 不必包含在 {} 中,但 popover-title 可以。看起来不一致接近成为一个错误

标签: javascript angularjs angular-ui-bootstrap


【解决方案1】:

将标题括在括号中,以便 Angular 知道获取内容。

<button popover-is-open="sm.isOpen" 
    popover-template="'something.html'" 
    popover-placement="top" popover-title="{{sm.popoverTitle}}"/>

【讨论】:

    猜你喜欢
    • 2015-01-12
    • 1970-01-01
    • 1970-01-01
    • 2014-05-04
    • 1970-01-01
    • 2018-09-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多