about 8 years ago
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
and we write this text within curly brackets as follows:
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:
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...!
Can you help out the community by solving one of the following Javascript problems?
Do activity (Answer, Blog) > Earn Rep Points > Improve Rank > Get more opportunities to work and get paid!
For more topics, questions and answers, please visit the Tech Q&A page.
0 Comment(s)