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

angular 动态设置blob链接给 ng-href时遇到unsafe 解决方案

时间:2015-05-14 12:21:11      阅读:250      评论:0      收藏:0      [点我收藏+]

标签:

  1. angular 默认情况下 的安全协议 是  https?|ftp|mailto|  

  2. 当我们使用blob 对象去产生url时,需要设定blob为安全协议

  3. var app = angular.module( ‘myApp‘, [] ).config( [
        ‘$compileProvider‘,
        function( $compileProvider )
        {   
            $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|chrome-extension):/);
            // Angular before v1.2 uses $compileProvider.urlSanitizationWhitelist(...)
        }])

   

angular 动态设置blob链接给 ng-href时遇到unsafe 解决方案

标签:

原文地址:http://my.oschina.net/u/1040928/blog/414712

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