I'm editing the question to make it more clear :
Using this code will return a Promise, very useful in some case. Service.ts :
async getElement(id: string): Promise<AngularFirestoreDocument<Element>> {
return this.firestore.doc<Element>(`/element/${id}`);
}
I'm looking for a way to return it as an object so it not linked with firebase anymore.
Here is my page.ts
async ngOnInit() {
this.elementId = this.route.snapshot.paramMap.get('id');
this.elementService.getElement(this.elementId).then(element$ => {
this.element= element$.valueChanges();
});
}
Any ideas on how to do it ?
I want to be able to do (off-line) operations like
this.element.name = 'New name';
and
{{element.name}}
I also have the same question for collections.