2014-04-05 78 views
5

有沒有人知道如何使用Ionic(http://ionicframework.com/docs/)顯示包裝在科爾多瓦容器內的本地圖像?如何顯示本地:/ /圖像在離子框架+科爾多瓦?

GET不安全:本地:///img/thumbs/myImage.jpg未處理的協議

我科爾多瓦開發的應用

,當應用程序在設備上運行,目前我得到這個錯誤BlackBerry 10 & Android使用離子框架。這個應用程序顯示打包科爾多瓦內部應用程序itselfusing以下模板圖像:

<img ng-src="img/thumbs/{{img.path}}" ng-click="fooBar(img)"/> 

爲什麼發生這個錯誤?

回答

2

我發現這是關於BlackBerry 10支持的離子框架的一個限制。我在這裏記錄了一個bug:http://github.com/driftyco/ionic/issues/1066

爲了解決這個問題,我已經手動編輯離子庫,以包括對本地協議的支持。

+5

也許包括代碼?沒有它,有一個問題,但不是解決方案。 –

0

角問題

替換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\/)/;