我有这样的观点:
<script type="text/x-handlebars" data-template-name="articlesOne">
<div class="main">
<div id="articlesOne">
<h2 id="article-title">{{App.ArticlesOneController.article.title}}</h2>
<h3 id="article-lead">{{App.ArticlesOneController.article.lead}}</h3>
<div id="article-body">{{App.ArticlesOneController.article.body}}</div>
</div>
</div>
</script>
当我更改 App.ArticlesOneController.article.title
时属性(property),例如 <p>Pragraph</p>
,浏览器显示纯文本,未解析为 HTML。
由于在该 div 上构建了一个编辑器,我想以 HTML 形式显示它。我该怎么做?
最佳答案
您应该尝试使用三重括号 {{{App.ArticlesOneController.article.title}}}
。我认为这个链接对您有用:Show property which includes html tags
关于view - Ember.js View 参数将 html 显示为纯文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12446292/