Ionic+Firebase: Error: Uncaught (in Promise): [Object Object]

Asked

Viewed 100 times

1

I am new to Ionic and I am facing a problem, I have this application that works with camera/ gallery, and I believe the error is in the file . ts is the code:

save(animal) {
      this.dbService.save(animal).then(
        response => {
          // ALERT DE QUE FOI SALVO COM SUCESSO
          let storageRef = firebase.storage().ref();
          let imageRef = storageRef.child('image').child(response.key);

          imageRef.putString(this.animal.fotoAtual, 'data_url')
            .then(snapshot => {
              console.log(snapshot)
            }, err => {

          })
          this.toastrService.show('Registro realizado com sucesso!', 3000).present();
            this.navCtrl.setRoot(ListPage);
        },
        error => {
          // ALERT DE QUE DEU ERRO NA FUNÇÃO
        }
      ), (r => console.log(r));
      }

in the case in my application I have a Provider centralizing application crud, there in it I have the save method that is so:

save(animal: any){
   return this.dbRef
        .push(animal);
  }

thank you in advance

  • Good evening, is the full error log just the title or have more? If you have help.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.