渲染文本与angularJs HTML [英] Render text as html with angularJs
本文介绍了渲染文本与angularJs HTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我如何使字符串呈现为HTML?在做类似:
How do I make the string to be rendered as HTML? When doing something like:
<div>
{{ text }}
</div>
输出只能显示在文本意义AB
The output is just displayed at text meaning " ab "
推荐答案
正前pression:
Regular expression:
var pattern = new RegExp(keywords.join('|'), "g");
var result = text.match(pattern);
撕心裂肺的字符串作为HTML:
Rending a string as HTML:
<div ng-bind-html="text"></div>
P.S:由于这是两个不同的问题,下一次你应分别张贴
P.S: Since these are two different questions, next time you should post them separately.
这篇关于渲染文本与angularJs HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文