NOTE / EDIT : This code if for AngularJS, formerly known as Angular. I will leave the showcase for those who google and stumble upon this searching for Angular 1.x. solutions
RANT: (The whole idea of renaming Angular 1.x into AngularJS and after, naming Angular2 with Angular is one of most idiotic things I saw recently. Angular 2 and 4 should be named Angular2 and Angular4, Angular 1.x should have remained Angular) /end of rant
Example is a working code in one of our apps, should illustrate what I mean
$scope.takePicture = function(type) {
if (typeof(Camera) != 'undefined') {
var photoType = Camera.PictureSourceType.CAMERA;
if (type == 'gallery') {
photoType = Camera.PictureSourceType.SAVEDPHOTOALBUM;
}
var options = {
quality : 80, // Damir sa 75
destinationType : Camera.DestinationType.DATA_URL,
sourceType : photoType,
allowEdit : false, // Damir (true -> false)
encodingType: Camera.EncodingType.JPEG,
targetWidth: 625, //Damir sa 600
targetHeight: 800, //Damir sa 600
// popoverOptions: CameraPopoverOptions - Damir
saveToPhotoAlbum: false,
correctOrientation: true
};
$cordovaCamera.getPicture(options).then(function(imageData) {
$scope.images.push({slikaB64:imageData,opis:null});
}, function(err) {
//alert(JSON.stringify(err));
});
}
else
$scope.images.push({slikaB64:"R0lGODlhDwAPAKECAAAAzMzM/////wAAACwAAAAADwAPAAACIISPeQHsrZ5ModrLlN48CXF8m2iQ3YmmKqVlRtW4MLwWACH+H09wdGltaXplZCBieSBVbGVhZCBTbWFydFNhdmVyIQAAOw==",opis:'123'})
}