![]() |
VOOZH | about |
The ng-bind-html Directive is used to bind the innerHTML of an HTML element to application data and remove dangerous code from the HTML string. The $sanitize service is a must for the ng-bind-html directive. It is supported by all HTML elements.
Syntax:
<element ng-bind-html="expression"> Contents... </element>
Approach:
Example 1: This example illustrates the rendering of the HTML content values using AngularJS.
Output:
Example 2: This example illustrates the implementation of the ng-bind-html directive to display the HTML content value using AngularJS.
Output: