[英]HTML tag in scope of angularjs
我需要在控制器的$ scope.myText中放入<br />
标签,该怎么做?
Something like $sce.trustAsHtml("<br />")
should work. 像
$sce.trustAsHtml("<br />")
应该可以工作。
$sce.trustAsHtml()
returns a string that is safe to use with ng-bind-html
. $sce.trustAsHtml()
返回可与ng-bind-html
一起安全使用的字符串。 You can read more about it here 你可以在这里读更多关于它的内容
$sce.trustAsHtml vs. ng-bind-html $ sce.trustAsHtml与ng-bind-html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.