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

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

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

1.app.js中添加

angular.module(‘epcui‘, [
    ‘ngSanitize‘// ngSanitize
])

2.html中添加sanitize

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



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

本文出自 “蛋蛋” 博客,请务必保留此出处http://yh118.blog.51cto.com/8638176/1923807

文章来自:http://yh118.blog.51cto.com/8638176/1923807
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3