如何使用AngularJS模板渲染html [英] How to render html with AngularJS templates
本文介绍了如何使用AngularJS模板渲染html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我的模板:
<div class="span12">
<ng:view></ng:view>
</div>
这是我的视图模板:
<h1>{{stuff.title}}</h1>
{{stuff.content}}
我得到 content
作为html,我想在视图中显示它,但我得到的只是原始的html代码。如何呈现该HTML?
I am getting the content
as html and I want to display that in a view, but all I am getting is raw html code. How can I render that HTML?
推荐答案
使用 -
<span ng-bind-html="myContent"></span>
你需要告诉angular不要逃避它。
You need to tell angular to not escape it.
这篇关于如何使用AngularJS模板渲染html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文