(pathOrRef: string | DocumentReference<T>)
| 222 | doc<T>(path: string): AngularFirestoreDocument<T>; |
| 223 | doc<T>(ref: DocumentReference): AngularFirestoreDocument<T>; |
| 224 | doc<T>(pathOrRef: string | DocumentReference<T>): AngularFirestoreDocument<T> { |
| 225 | let ref: DocumentReference<T>; |
| 226 | if (typeof pathOrRef === 'string') { |
| 227 | ref = this.firestore.doc(pathOrRef) as firebase.firestore.DocumentReference<T>; |
| 228 | } else { |
| 229 | ref = pathOrRef; |
| 230 | } |
| 231 | const refInZone = this.ngZone.run(() => ref); |
| 232 | return new AngularFirestoreDocument<T>(refInZone, this); |
| 233 | } |
| 234 | |
| 235 | /** |
| 236 | * Returns a generated Firestore Document Id. |
no outgoing calls