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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章