@voodoodrul wrote:
I am using $cordovaFile.writeFile() to store images in cordova.file.dataDirectory (or cordova.file.applicationStorageDirectory). The file gets written without issue. I would like to use the file as an ng-src for an
<img>
. On Android, this might look something like: file:///data/data/com.ionicframework.starter924206/files/img-49444.jpgWhile the URL looks good to me, it simply doesn't render. I have tried:
Adding this CSP tag to index.html
<meta http-equiv="Content-Security-Policy" content="img-src 'self' data: blob: filesystem:;media-src mediastream:">
Messing around with $compileProvider, like:
app.js.config(function ($stateProvider, $urlRouterProvider, $compileProvider) { $compileProvider.imgSrcSanitizationWhitelist(/^\s*(https?|ftp|file|chrome-extension):|data:image\//); }
And config.xml Cordova whitelists. Nothing works.
Any suggestions out there?
Posts: 1
Participants: 1