AngularJS provides ngSanitize module to securely parse and manipulate HTML data in your application.
To use it include the angular-sanitize.js file and set ngSanitize as a dependency in your angular app.
var app = angular.module('sanitizeExample', ['ngSanitize']);
app.controller('ExampleController',function ($scope, $sce) {
var snippet ='<p style="color:blue">an html\n' +
'<em onmouseover="this.textContent=\'PWN3D!\'">click here</em>\n snippet</p>';
$scope.trustedSnippet = $sce.trustAsHtml(snippet); //sce=Strict Contextual Escaping
});
The snippet may contain HTML, CSS, URLs and JavaScript code which you want to safely render in your app.