We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thank you very much for sharing your project 👍
In firebaseService.ts you have login(credentials) returning an Observable object
firebaseService.ts
login(credentials)
login(credentials) { var that = this return new Observable(observer => { return firebase.auth().signInWithEmailAndPassword(credentials.email, credentials.password) .then(function (authData) { console.log("Authenticated successfully with payload-", authData); observer.next(authData) }).catch(function (_error) { console.log("Login Failed!", _error); observer.error(_error) }) }); }
In my project I had something similar but returning a Promise
login(credentials): Promise<any> { return new Promise((resolve: () => void, reject: (reason: Error) => void) => { firebase.auth().authWithPassword({"email": credentials.email, "password": credentials.password}, (error: Error) => { if (error) { console.error('ERROR @ signInWithEmailPassword :', error); reject(error); } else { //console.log("Authenticated successfully:", this.authData); resolve(); } }); }); }
What is the best practice for an ionic app? And when would you use one instead of the other?
(sorry if my questions are stupid but this technology is still a bit foreign to me)
The text was updated successfully, but these errors were encountered:
Never mind. Found the answer!
Sorry, something went wrong.
No branches or pull requests
Thank you very much for sharing your project 👍
In
firebaseService.ts
you havelogin(credentials)
returning an Observable objectIn my project I had something similar but returning a Promise
What is the best practice for an ionic app? And when would you use one instead of the other?
(sorry if my questions are stupid but this technology is still a bit foreign to me)
The text was updated successfully, but these errors were encountered: