Angular / Firebase / Firestore - How to import firebase to use `serverTimestamp`
Solution 1:
Ok, so the following seems to work. Not sure if it's 100% correct.
Model/Interface
import { FieldValue, serverTimestamp } from "firebase/firestore";
export interface Folder extends Base {
created: typeof serverTimestamp | FieldValue | Date;
}
Component
import { serverTimestamp } from "firebase/firestore";
---
new(){
this.afs.collection<Model>(`path`).add({
created: serverTimestamp()
})
}