I am trying to add html to a div as follows:
$scope.thehtml = $sce.trustAsHtml("<b>hello</b>") <div ng-bind-html="thehtml"> </div>
I see the following error in the console:
TypeError: undefined is not a function at htmlParser (js/angular/angular-sanitize.js:205:17) at $sanitize (js/angular/angular-sanitize.js:119:5) at Object.ngBindHtmlWatchAction [as fn] (js/angular/angular-sanitize.js:420:15) at h.$get.h.$digest (js/angular/angular.min-125.js:98:396)
angular -sanitize.js: 205: 17:
if ( html.indexOf("");
Apparently html is not considered as a string, so the error in indexOf?
I included angular -sanitize.js and added the 'ngSanitize' module to the application.
source share