Advertisement
Guest User

Untitled

a guest
Oct 10th, 2017
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public takePicture(sourceType) {
  2.         this.photosService.takePicture(sourceType)
  3.             .then((newFileName) => {
  4.                 this.loading = this.loadingCtrl.create({
  5.                     content: 'Ajout de la photo...',
  6.                 })
  7.                 this.loading.present()
  8.                 return this.photosService.upload(this.venue.id, newFileName)
  9.             })
  10.             .then((data: FileUploadResult) => {
  11.                 // stuff with data returned by server
  12.                 this.loading.dismissAll()
  13.                 this.resetVenuePhotoProfile()
  14.                 this.presentToast('Photo ajoutée')
  15.             })
  16.             .catch(err => {
  17.                 if (this.loading)
  18.                     this.loading.dismissAll()
  19.                 this.presentToast(err)
  20.             })
  21.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement