If our text contains some html content, then we have to use ng-bind-html directive in angular js, else our html content will not be parsed and will be rendered as it is.
Example:
If our text is
$scope.Val = "<span> Something </span>"
and we write this text within curly brackets as follows:
<div> {{Val}} </div>
then the text will be rendered as it is i.e. <span> Something </span>
Therefore in order to get this html content parsed we have to write it as follows:
<div ng-bind-html="Val"></div>
Now the text will be rendered as Something .
Note: Make sure to include ngSanitize
module on your app
eg: var app = angular.module('myApp', ['ngSanitize']);
Hope it helps...!
0 Comment(s)