Angularjs ng-bind-html Instruction
Angularjs instance
Binding <p> InnerHTML to variable myText:
Run Result:
My name is:
John Doe
Note: This instance contains the "Angular-sanitize.js" file, which removes the dangerous code in HTML.
Definitions and usage
The ng-bind-html directive is a secure way to bind content to HTML elements.
When you want Angularjs to write HTML in your application, you need to detect some dangerous code. By introducing the "angular-santize.js" module in the application, the Ngsanitize function is used to detect the security of the code. In your application, you can does so by running the HTML code through the Ngsanitize function.
Grammar
<element ng-bind-html= "expression" ></element>
All HTML elements support this directive.
Parameter values
value |
Description |
Expression |
Specifies the variable or expression to execute. |
Above is the ANGULARJS ng-bind-html instruction example Detailed introduction, has the need friend to be possible under the reference.