简体   繁体   中英

HTML tag in scope of angularjs

我需要在控制器的$ scope.myText中放入<br />标签,该怎么做?

Something like $sce.trustAsHtml("<br />") should work.

$sce.trustAsHtml() returns a string that is safe to use with ng-bind-html . You can read more about it here

$sce.trustAsHtml vs. ng-bind-html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM