I am using ng-cordova camera plugin to click picture but after clicking picture app get restart
Code:
$scope.getPhoto = function() {
var options = {
quality : 50,
destinationType : Camera.DestinationType.NATIVE_URI,
sourceType : Camera.PictureSourceType.CAMERA,
allowEdit : false,
encodingType: Camera.EncodingType.JPEG,
targetWidth: 300,
targetHeight: 300,
popoverOptions: CameraPopoverOptions,
saveToPhotoAlbum: true
};
if(typeof $scope.lastPhoto === 'undefined') {
$scope.lastPhoto = [];
}
console.log("Inside get photo");
$cordovaCamera.getPicture(options).then(function(imageURI) {
console.log("Inside Home Control Camera");
console.log(imageURI);
$scope.lastPhoto.push(imageURI);
//$scope.lastPhoto = imageURI;
console.log( $scope.lastPhoto);
//$scope.lastPhoto = imageURI;
}, function(err) {
console.log("error in camera");
console.err(err);
});
};
Neither success nor error function is calling after clicking picture app just restarts.
I tried to find answers - I find this http://stackoverflow.com/a/27428455/1622022 but these solution does not solve this problem.
If anyone know solution please share .
Thanks