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
- Introduction to Model View View Model (MVVM)
- Laravel | Route::resource vs Route::controller
- Laravel | Controller Basics
- How to insert HTML content into an iFrame using jQuery?
- How to insert text into the textarea at the current cursor position?
- How to convert string into a number using AngularJS ?
- HTML | view Event Property
- How to Hide an HTML Element in Mobile View using jQuery ?
- How to insert spaces/tabs in text using HTML/CSS?
- AngularJS | ng-bind-html Directive
- AngularJS | HTML DOM
- How to use AngularJS to Display HTML content value ?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.