码迷,mamicode.com
首页 > Web开发 > 详细

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

时间:2017-05-09 17:41:38      阅读:2342      评论:0      收藏:0      [点我收藏+]

标签:ng-bind-html

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

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

标签:ng-bind-html

原文地址:http://yh118.blog.51cto.com/8638176/1923807

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!