import { AngularFireAuth } from '@angular/fire/auth';
import { AngularFirestore } from '@angular/fire/firestore';
constructor(
private afAuth: AngularFireAuth,
private afs: AngularFirestore,) {
}
Use case 1:
createdDate: firebase.firestore.FieldValue.serverTimestamp(),
Use case 2:
const result: firebase.auth.UserCredential = await this.afAuth.auth.signInWithCredential(credential);
For above I need to import this:
import * as firebase from 'firebase';
Since firebase
is a very big JS library I would like to do it in a more optimized way. Can you tell me how to do that?
Note: Here I use AngularFire
. But how can I get these models? firebase.auth.UserCredential
If you want clean import and optimized import, I suggest to use the official library for angular with firebase: AngularFire wich is well documented and up to date.
And inside for the interfaces or class, you can use probably:
import * as firebase from 'firebase/app';
And still continue to use : firebase.auth.UserCredential
in your code