Last active
October 26, 2018 17:28
-
-
Save shamique/d247d3471e4790247cc057fbbb183c6c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uploadPhoto() { | |
let loading = this.loader.create({ | |
title: 'Wait', | |
subTitle: 'Uploading...' | |
}); | |
loading.present(); | |
this.cognitoService | |
.getLoggedUser() | |
.then(userToken => { | |
this.s3Service.upload(this.imageData, this.imageName, userToken).then( | |
res => { | |
loading.dismiss(); | |
this.imageName = ""; | |
this.imageData = ""; | |
alert("Image uploaded!"); | |
}, | |
err => { | |
loading.dismiss(); | |
alert("Error in image upload!"); | |
} | |
); | |
}) | |
.catch(err => console.log(err)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment