Angular sanitize / ng-bind-html not working?

后端 未结 5 2005
名媛妹妹
名媛妹妹 2020-12-02 18:03

I\'ve got a repeater set up and can get data to display as long as there is no html within it.

I\'ve included angular-sanitize.js and have tried using <

5条回答
  •  抹茶落季
    2020-12-02 18:40

    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

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

提交回复
热议问题