有人知道如何使用Ionic (http://ionicframework.com/docs/)来显示封装在Cordova容器中的本地图像吗?
当应用程序在设备上运行时,我目前正在收到这个错误:
变得不安全:本地://img/thumbs/myImage.jpg未处理协议
我的Cordova应用程序是为BlackBerry 10 & Android开发的,使用的是离子框架。该应用程序使用以下模板显示自己封装在Cordova应用程序中的图像:
<img ng-src="img/thumbs/{{img.path}}" ng-click="fooBar(img)"/>为什么会发生此错误?
发布于 2014-04-08 23:03:56
我发现这是关于BlackBerry 10支持的离子框架的一个当前限制。我在这里记录了一个bug:http://github.com/driftyco/ionic/issues/1066
为了解决这个问题,我已经手动编辑了离子库,以包括对本地协议的支持。
发布于 2015-04-02 16:36:22
角度问题
替换ionic.bundle.js中的下列行
var aHrefSanitizationWhitelist = /^\s*(https?|ftp|mailto|tel|file):/,
imgSrcSanitizationWhitelist = /^\s*((https?|ftp|file|blob):|data:image\/)/;至
var aHrefSanitizationWhitelist = /^\s*(https?|ftp|mailto|tel|file|local):/,
imgSrcSanitizationWhitelist = /^\s*((https?|ftp|file|blob|local):|data:image\/)/;发布于 2014-08-26 23:03:08
我只是把请求拉到角度,因为这是一个角度限制,而不是离子框架。您可以在这里看到拉请求:https://github.com/angular/angular.js/pull/8787。
https://stackoverflow.com/questions/22886437
复制相似问题