I want to take photos of different items or multiple photos for one item, but I am struggling to figure out how I will be able to push the images into an array.
a single image gets displayed from the first line :
<img ng-show="imgURI !== undefined" ng-src="{{imgURI}}" style="text-align: center">
but with the ng-repeat it doesn't display one image.
I quess my issues are:
- what is wrong with my ng-repeat?
- are the images actually being stored inside of the array correctly?
HTML
<button class="button button-full button-assertive" ng-click="takePhoto()">
Take Photo
</button>
<img ng-show="imgURI !== undefined" ng-src="{{imgURI}}" style="text-align: center">
<ion-item class="item item-assertive">Test array</ion-item>
<div ng-repeat="x in array">
<img ng-src="{{x.imgURI}}">
</div> center">
Javascript
$scope.takePhoto = function () {
var options = {
quality: 75,
destinationType: Camera.DestinationType.DATA_URL,
sourceType: Camera.PictureSourceType.CAMERA,
allowEdit: true,
encodingType: Camera.EncodingType.JPEG,
targetWidth: 300,
targetHeight: 300,
popoverOptions: CameraPopoverOptions,
saveToPhotoAlbum: false
};
$scope.array = [];
$cordovaCamera.getPicture(options).then(function (imageData) {
$scope.imgURI = "data:image/jpeg;base64," + imageData;
$scope.imgURI = array;
}, function (err) {
// An error occured. Show a message to the user
});
}
