mirror of
https://github.com/arnaucube/openEventsPlatformApp.git
synced 2026-02-08 04:06:40 +01:00
implemented upload file image for new event
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user