Skip to content

Commit 22e2883

Browse files
authored
fix(afs): fix regression keeping one from overriding collection.doc type (#2668)
1 parent 7f89643 commit 22e2883

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/firestore/collection/collection.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ export class AngularFirestoreCollection<T = DocumentData> {
141141
/**
142142
* Create a reference to a single document in a collection.
143143
*/
144-
doc(path?: string): AngularFirestoreDocument<T> {
145-
return new AngularFirestoreDocument<T>(this.ref.doc(path), this.afs);
144+
doc<T2 = T>(path?: string): AngularFirestoreDocument<T2> {
145+
// TODO is there a better way to solve this type issue
146+
return new AngularFirestoreDocument(this.ref.doc(path) as any, this.afs);
146147
}
147148
}

0 commit comments

Comments
 (0)