Hello, I’m John and I am trying to create a self increasing slide box where I can add Images from the Gallery to it.
Let’s start with the slide item using ‘ng-repeat’ property :
<ion-slide ng-repeat="image in images">
<img class="add-collection-item-div-image-container" src="{{image.imageUrl}}" id="myImage" >
</ion-slide>
Now there is the ‘cameraSuccess’ function wich is called when I select an image from the pic gallery or from the device camera:
function cameraSuccess(imageURI) {
if (imageURI.substring(0, 21) == "content://com.android") {
var photo_split = imageURI.split("%3A");
imageURI = "content://media/external/images/media/" + photo_split[1];
}
$scope.images[$scope.images.length] = { imageUrl: imageURI};
$ionicSlideBoxDelegate.update();
}
The problem is : The picture taken from the Camera and the picture that comes from the gallery is never displayed on the ion-slide item.
These are the imageUri I get from the device camera and the pic gallery:
Pic gallery imageUri : "content://media/external/images/media/5240"
Device camera imageUri : "file:///storage/emulated/0/Android/data/com.ionicframework.app802132/cache/478.jpg"
Please does any one have a solution for that?
Thanks!
[EDIT]
Removed this code
.config(function ($stateProvider, $urlRouterProvider, $compileProvider) {
$compileProvider.imgSrcSanitizationWhitelist(‘img/’);
})
from ‘app.js’ and the Image from the device Camera works now but the image from the Pic Gallery still does not display…