Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- onFileSelected(event) {
- this.prepareLoader()
- .then(loader => {
- loader.present();
- console.log('To Upload:', event);
- this.selectedImage = event.target.files[0];
- const reader = new FileReader();
- reader.onloadend = (e) => {
- // e.target['result'];
- this.userService.setUserProfilePicture(this.uid, this.selectedImage)
- .then((res) => {
- console.log('Imagem alterada', res);
- // Click to close the edition mode
- this.toggleEdit();
- this.closeFab.close();
- this.prepareToast('Profile picture updated');
- })
- .catch( err => this.presentAlert(err.message))
- .then(() => loader.dismiss())
- }
- reader.readAsDataURL(this.selectedImage);
- })
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement