如何将html文本传递给angular js模板。
以下模板的示例我想将task.data传递为“这是任务xyz任务状态”
现在在网页上我可以看到html标签。请帮我解决这个问题。
<script type="text/ng-template" id="default.tooltip.tmpl.html">
<div class="gantt-task-info" ng-style="css">
<div class="gantt-task-info-content">
{{ task.data }}</br>
{{ task.link1 }} </br>
<small>
{{ task.isMilestone === true && (task.from | date:'MMM d, HH:mm') || (task.from | date:'MMM d, HH:mm') + ' - ' + (task.to | date:'MMM d, HH:mm') }}
</small>
</div>
</div>
</script>
答案 0 :(得分:0)
您可以使用ng-bind-html指令解决问题
见下面的参考代码
<div class="gantt-task-info-content">
<p ng-bind-html="task.data"></p></br>
<p ng-bind-html="task.link1"></p></br>
希望这会有所帮助