我试图将HTML字符串绑定到角度2工具提示。但它呈现为HTML显示为普通字符串。有没有办法将字符串渲染为HTML。
这是我的代码:
在视图中:
<span class="icon-status" mdTooltip="{{value.status}}"></span>
零件:
value.status = this.sanitizer.bypassSecurityTrustHtml(this.getStatusTemplate(value.status));
getStatusTemplate(status: IIconStatus): string{
let HTML =`
<div>Event Title</div>
<div class="">
<table>
<thead>
<th>User</th>
<th>User</th>
<th>User</th>
<th>User</th>
</thead>
</table>
</div>
`;
return HTML;}
提前致谢。
对我们来说是坏消息:角度材料工具提示不支持HTML,目前,他们没有意图支持它。 Here更多信息。