2017-08-22 5 views

Antwort

0

Dieses Beispiel aus meiner Anmeldung Komponente ist:

actions: { 
    signUp: function() { 
     let model = this.get('model'); 
     let ref = this.get('firebaseApp').auth(); 
     ref.createUserWithEmailAndPassword(model.get('email'), model.get('password')) 
      .then(function (userData) { 
       this.get('session') 
        .open('firebase', { 
         provider: 'password', 
         'email': model.get('email'), 
         'password': model.get('password') 
        }) 
        .then(function() { 
         model.set('id', userData.uid); 
         model.save() 
          .then(function() { 
           this.get('router').transitionTo('login'); 
          }.bind(this)) 
         ; 
        }.bind(this)) 
        .catch(function (error) { 
         this.set('errorMessage', error.message); 
        }.bind(this)); 
      }.bind(this)) 
      .catch(function (error) { 
       this.set('errorMessage', error.message); 
      }.bind(this)) 
     ; 
    } 
} 
Verwandte Themen