I’m currently working on a ionic/cordova application developed with angularJS. I need to include an image provided by a secured API requiring an HTTP authorization in a template and can’t find a way to make it work. The API returns the jpeg with the appropriate response headers.
Here is the way my app calls the image :
$http(req).
then(function (data, status, headers, config) {
return data;
});
I tried to insert the « code » of this jpeg in a src/ng-src/data-ng-src with a base64 reencoded string (or not) and even tried to convert it in a Blob in order to use the FileReader();
I also made an attempt to sanitize it with $compileProvider.imgSrcSanitizationWhitelist(/^\s(https|file|blob|cdvfile|content):|data:image\//);
None of these solutions worked !
Thanks Thanks