【问题标题】:ng template binding with button tooltip is not working带有按钮工具提示的 ng 模板绑定不起作用
【发布时间】:2019-01-17 06:54:39
【问题描述】:

tolTemplate 未与 [tooltip] 绑定

<ng-template #tolTemplate>
  Just another: 
</ng-template>
<button type="button" class="btn btn-success" [tooltip]="tolTemplate">
  Show me tooltip with html
</button>

任何想法,如何解决这个问题。

\

【问题讨论】:

  • 您能提供更多信息吗?你有什么绑定到显示工具提示按钮?
  • 我试图用 显示一个 HTML 只是另一个:“一个 HTML 段”
  • 将字符串值分配给 tolTemplate 变量,这可能会解决您的问题
  • 我要求对象(可能是 json)绑定到该按钮工具提示
  • 这里是您想要实现的示例stackblitz.com/angular/rorynnredxy

标签: angular ng-template property-binding


【解决方案1】:

尝试添加到按钮属性contentTypecontent-type(取决于版本角度)。

<ng-template #tolTemplate>
  Just another: 
</ng-template>
<button type="button" class="btn btn-success" [tooltip]="tolTemplate" contentType="template">
  Show me tooltip with html
</button>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-12-29
    • 2015-02-14
    • 2013-05-13
    相关资源
    最近更新 更多