Created
August 29, 2015 21:23
-
-
Save mayroncachina/7cd64450238708b4536a to your computer and use it in GitHub Desktop.
Phonegap save picture on library
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
navigator.camera.getPicture(onSuccess, onFail, | |
{ quality: 25, | |
destinationType : Camera.DestinationType.FILE_URI, | |
sourceType : Camera.PictureSourceType.CAMERA, | |
allowEdit : true, | |
encodingType: Camera.EncodingType.JPEG, | |
//popoverOptions: CameraPopoverOptions, | |
saveToPhotoAlbum: true | |
}); | |
function onSuccess(imageData) { | |
alert($scope.index) | |
$scope.$apply(function(){ | |
$scope.index = $scope.index+1 | |
$scope.imagens.push({"url":imageData, id: $scope.index, active:false}) | |
}); | |
console.log($scope.imagens) | |
} | |
function onFail(message) { | |
alert('Failed because: ' + message); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment