JavaScript Code- < script type = "text/javascript" > var app = angular . module ( 'App' , [ "ngSanitize" ]); app . controller ( 'AppCtrl' , [ '$scope' , '$sce' , function ( $scope , $sce ){ $scope . name = "" ; $scope . processHtmlCode = function () { $scope . trustedMessage = $sce . trustAsHtml ( $scope . name ); } }]); </ script > HTML code- < span ng-bind-html = "trustedMessage" ></ span > How To Preventing Cross Site Scripting (XSS) in Angular? How Angular Protects Us From XSS Attacks? I hope you are enjoying with this post! Please share with you friends. Thank you so much!
Angular, React, JavaScript, Java, PHP, SQL, C#, Vue, NodeJs, TypeScript and Interview Questions Answers