Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
angularjs ng使用html字符实体绑定html var text1=“sometext”; var text2=“b某些文本/b”;_Angularjs_Ng Bind Html_Ngsanitize - Fatal编程技术网

angularjs ng使用html字符实体绑定html var text1=“sometext”; var text2=“b某些文本/b”;

angularjs ng使用html字符实体绑定html var text1=“sometext”; var text2=“b某些文本/b”;,angularjs,ng-bind-html,ngsanitize,Angularjs,Ng Bind Html,Ngsanitize,ng bind html=“text1”工作正常。结果是一些文本 但是ng bind html=“text2”不起作用。结果是一些文本 如何使ng bind html=“text2”工作。 多谢各位 @simoco你为什么编辑这个?我想显示的第一个结果是html中的粗体文本,第二个结果是html中的某些文本。在这两种情况下都需要粗体文本吗?我再次编辑:)谢谢。@dfsq是的。特别是第二个。可能是重复的 var text1 = "<b>sometext</b>";

ng bind html=“text1”
工作正常。结果是一些文本 但是
ng bind html=“text2”
不起作用。结果是一些文本

如何使
ng bind html=“text2”
工作。
多谢各位

@simoco你为什么编辑这个?我想显示的第一个结果是html中的粗体文本,第二个结果是html中的某些文本。在这两种情况下都需要粗体文本吗?我再次编辑:)谢谢。@dfsq是的。特别是第二个。可能是重复的
var text1 = "<b>sometext</b>";     
var text2 = "&lt;b&gt;sometext&lt;/b&gt;";