zelocalhost
zelocalhost

Reputation: 1183

HTML tag in scope of angularjs

I need to put a <br /> tag in $scope.myText in a controller, how to do that ?

Upvotes: 1

Views: 40

Answers (1)

Dalorzo
Dalorzo

Reputation: 20014

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

Upvotes: 1

Related Questions