angularjs解决方案之 Error: [$sce:unsafe]

快来打我* 2022-10-01 13:44 239阅读 0赞

angularjs中无法直接使用ng-bind-html:

  1. <div ng-bind-html="item.text | highlight: $select.search"></div>

1.app.js中添加

  1. angular.module('epcui', [
  2. 'ngSanitize'// ngSanitize
  3. ])

2.html中添加sanitize

  1. <script src="js/angular/angular-sanitize.js"></script>

借鉴:http://www.cnblogs.com/yshyee/p/4272180.html

转载于:https://blog.51cto.com/dd118/1923807

发表评论

表情:
评论列表 (有 0 条评论,239人围观)

还没有评论,来说两句吧...

相关阅读