Skip to content

Instantly share code, notes, and snippets.

@morenoh149
Created March 20, 2014 23:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save morenoh149/9676256 to your computer and use it in GitHub Desktop.
Save morenoh149/9676256 to your computer and use it in GitHub Desktop.
.controller('SelectPicCtrl', function($scope, PetService) {
$scope.pets = PetService.all();
$scope.launchPhotoLibrary = function() {
navigator.camera.getPicture( cameraSuccess, cameraError,
{ sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY } );
};
function cameraSuccess(imageURI) {
$scope.image = document.getElementById('myImage');
$scope.image.src = imageURI;
}
function cameraError(message) {
alert('Failed because: ' + message);
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment