implemented upload file image for new event

This commit is contained in:
arnaucode
2017-06-23 16:45:13 +02:00
parent baa74e1921
commit 82cceaff53
247 changed files with 51054 additions and 49 deletions

View File

@@ -1,7 +1,8 @@
angular.module('app.newEvent', ['pascalprecht.translate', 'ui-leaflet'])
.controller('NewEventCtrl', function($scope, $http, $ionicModal, $timeout,
$ionicLoading, $filter, leafletData, leafletBoundsHelpers) {
$ionicLoading, $filter, leafletData, leafletBoundsHelpers,
$cordovaCamera) {
//initialization
@@ -16,6 +17,30 @@ angular.module('app.newEvent', ['pascalprecht.translate', 'ui-leaflet'])
}
};
//imgfile
$scope.selectImgFile = function() {
console.log("img");
var options = {
quality: 100,
destinationType: Camera.DestinationType.DATA_URL,
sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
allowEdit: true,
encodingType: Camera.EncodingType.PNG,
targetWidth: 500,
targetHeight: 500,
popoverOptions: CameraPopoverOptions,
saveToPhotoAlbum: false,
correctOrientation: true
};
$cordovaCamera.getPicture(options).then(function(imageData) {
$scope.event.imgpreview = "data:image/jpeg;base64," + imageData;
$scope.event.img = imageData;
}, function(err) {
console.log(err);
});
};
//get list of categories
$scope.categories;
$http.get(urlapi + 'categoriesList')