I am trying to use angularfire properly and type it. But I always have this error :
getMessages(): Observable<ChatMessage[]> {
return this.db.collection('chat').valueChanges();
I tried this workaround, but is not clean
getMessages(): Observable<ChatMessage[]> {
return <any>this.db.collection('chat').valueChanges();

this.db.collection('chat').valueChanges()are generic. My bet is thatcollectionis generic andthis.db.collection<ChatMessage>('chat').valueChanges()should work.ChatMessagetype so you probably have to specify it somewhere, andcollectionseemed like a logical answer. Anyway, someone seems to have posted an answer with a link :)