The ng-bind-html directive is a secure way of binding content to an HTML element. So in order to insert HTML into view, we use the respective directive.
While using AngularJS, write HTML in our corresponding application, we should check the HTML for dangerous or error prone code. By including the “angular-sanitize.js” module in the application we can do so by running the HTML code through the ngSanitize function.
It constitutes of 2 steps:
- Include the angular-sanitize.min.js resource,
- In a js file (controller or usually app.js), we must include ngSanitize,
angular.module('myApp', ['myApp.filters', 'myApp.services',
- Expressions: Specifies an expression or the value for the evaluation.
- Model-View-Controller(MVC) architecture for Node applications
- AngularJS | ng-controller Directive
- How to execute AngularJS controller function on page load ?
- HTML | DOM Audio controller Property
- HTML | view Event Property
- AngularJS | HTML DOM
- How to use AngularJS to Display HTML content value ?
- AngularJS | ng-bind-html Directive
- How to insert spaces/tabs in text using HTML/CSS?
- How to insert HTML content into an iFrame using jQuery?
- Laravel | Controller Basics
- Introduction to Model View View Model (MVVM)
- Laravel | Route::resource vs Route::controller
- What is GAV (Global as View)?
- Spring MVC with JSP View
- Laravel | View Basics
- Scala - View Bound
- Reader's View of a GeeksforGeeks webpage
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.