Angular sanitize / ng-bind-html not working?

  1. You need to include the angular-sanitize.js
    http://ajax.googleapis.com/ajax/libs/angularjs/1.0.3/angular-sanitize.js

  2. Add ‘ngSanitize‘ to you module dependencies

    var myApp = angular.module(‘myApp’, [‘ngSanitize’]);

  3. Don’t use the {{}} in the attribute

    <h1 ng-bind-html=”item.title”></h1>

  4. Don’t use $sce.trustAsHtml()

Leave a Comment