@@ -16,52 +16,52 @@ export class GetImagePage {
16
16
}
17
17
18
18
changePicture ( ) {
19
- // let loading = this.loadingCtrl.create();
20
- //
21
- // let actionSheet = this.actionsheetCtrl.create({
22
- // title: 'Upload picture',
23
- // cssClass: 'action-sheets-basic-page',
24
- // buttons: [
25
- // {
26
- // text: 'Camera',
27
- // icon: !this.platform.is('ios') ? 'camera' : null,
28
- // handler: () => {
29
- // loading.present();
30
- // return this.cameraProvider.getPictureFromCamera().then(picture => {
31
- // if (picture) {
32
- // this.chosenPicture = picture;
33
- // }
34
- // loading.dismiss();
35
- // }, error => {
36
- // alert(error);
37
- // });
38
- // }
39
- // },
40
- // {
41
- // text: !this.platform.is('ios') ? 'Gallery' : 'Camera Roll',
42
- // icon: !this.platform.is('ios') ? 'image' : null,
43
- // handler: () => {
44
- // loading.present();
45
- // return this.cameraProvider.getPictureFromPhotoLibrary().then(picture => {
46
- // if (picture) {
47
- // this.chosenPicture = picture;
48
- // }
49
- // loading.dismiss();
50
- // }, error => {
51
- // alert(error);
52
- // });
53
- // }
54
- // },
55
- // {
56
- // text: 'Cancel',
57
- // icon: !this.platform.is('ios') ? 'close' : null,
58
- // role: 'destructive',
59
- // handler: () => {
60
- // console.log('The user has cancelled the interaction.');
61
- // }
62
- // }
63
- // ]
64
- // });
65
- // return actionSheet.present();
19
+ let loading = this . loadingCtrl . create ( ) ;
20
+
21
+ let actionSheet = this . actionsheetCtrl . create ( {
22
+ title : 'Upload picture' ,
23
+ cssClass : 'action-sheets-basic-page' ,
24
+ buttons : [
25
+ {
26
+ text : 'Camera' ,
27
+ icon : ! this . platform . is ( 'ios' ) ? 'camera' : null ,
28
+ handler : ( ) => {
29
+ loading . present ( ) ;
30
+ return this . cameraProvider . getPictureFromCamera ( ) . then ( picture => {
31
+ if ( picture ) {
32
+ this . chosenPicture = picture ;
33
+ }
34
+ loading . dismiss ( ) ;
35
+ } , error => {
36
+ alert ( error ) ;
37
+ } ) ;
38
+ }
39
+ } ,
40
+ {
41
+ text : ! this . platform . is ( 'ios' ) ? 'Gallery' : 'Camera Roll' ,
42
+ icon : ! this . platform . is ( 'ios' ) ? 'image' : null ,
43
+ handler : ( ) => {
44
+ loading . present ( ) ;
45
+ return this . cameraProvider . getPictureFromPhotoLibrary ( ) . then ( picture => {
46
+ if ( picture ) {
47
+ this . chosenPicture = picture ;
48
+ }
49
+ loading . dismiss ( ) ;
50
+ } , error => {
51
+ alert ( error ) ;
52
+ } ) ;
53
+ }
54
+ } ,
55
+ {
56
+ text : 'Cancel' ,
57
+ icon : ! this . platform . is ( 'ios' ) ? 'close' : null ,
58
+ role : 'destructive' ,
59
+ handler : ( ) => {
60
+ console . log ( 'The user has cancelled the interaction.' ) ;
61
+ }
62
+ }
63
+ ]
64
+ } ) ;
65
+ return actionSheet . present ( ) ;
66
66
}
67
67
}
0 commit comments