Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var options = {
- quality: 50,
- destinationType: Camera.DestinationType.FILE_URI,
- sourceType: Camera.PictureSourceType.CAMERA,
- allowEdit: true,
- encodingType: Camera.EncodingType.JPEG,
- popoverOptions: CameraPopoverOptions,
- saveToPhotoAlbum: false,
- correctOrientation: true
- };
- $cordovaCamera.getPicture(options).then(function(sourcePath) {
- // alert("inside pic from sourcePath: " + sourcePath);
- var sourceDirectory = sourcePath.substring(0, sourcePath.lastIndexOf('/') + 1);
- var sourceFileName = sourcePath.substring(sourcePath.lastIndexOf('/') + 1, sourcePath.length);
- $cordovaFile.copyFile(sourceDirectory, sourceFileName, cordova.file.dataDirectory, sourceFileName).then(function(success) {
- $scope.uploadedImage = cordova.file.dataDirectory + sourceFileName;
- $scope.closeChoosephoto();
- }, function(error) {
- console.dir(error);
- });
- }, function(err) {
- console.log(err);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement