import { Injectable } from '@angular/core' ; import { Camera } from '@ionic-native/camera' ; import { ImagePicker } from '@ionic-native/image-picker' ; /**
 * This is the plugin service. Following the DRY approach I've created
 * a service that you can call when you want use plugins. A service because
 * you probabaly want to re-use the camera on multiple locations.
 */ @ Injectable ( ) export class PluginService { constructor ( private camera , private image_picker ) { } return public open_camera ( ) { return this . camera . getPicture ( { destinationType : this . camera . DestinationType ? this . camera . DestinationType . FILE_URI : 1 , sourceType : this . camera . PictureSourceType ? this . camera . PictureSourceType . CAMERA : 1 , encodingType : this . camera . EncodingType ? this . camera . EncodingType . JPEG : 0 , quality : 100 , allowEdit : false , saveToPhotoAlbum : true , correctOrientation : true } ) ; } return public open_albums ( ) { return this . image_picker . getPictures ( { quality : 100 , maximumImagesCount : 15 , } ) ; } }