Skip to content

feat(firestore): allow collection and doc from ref - #1487

Merged
davideast merged 1 commit into
angular:masterfrom
Maistho:issue-1337-firestore-from-ref
Mar 7, 2018
Merged

davideast merged 1 commit into
angular:masterfrom
Maistho:issue-1337-firestore-from-ref

Conversation

@Maistho

@Maistho Maistho commented Feb 27, 2018

Copy link
Copy Markdown
Contributor

Checklist

Description

Allows firestore collection and doc to be constructed from both references and string paths.

Do I need to add better tests? I was not sure how to get a reference easily, so I just took one from afs, which seems a bit backwards in a way.

Also not sure if there are any required documentation changes. Let me know in that case!

Code sample

Changes the interfaces to:

collection<T>(pathOrRef: string | CollectionReference, queryFn?: QueryFn): AngularFirestoreCollection<T>
doc<T>(pathOrRef: string | DocumentReference): AngularFirestoreDocument<T>

Allows firestore collection and doc to be constructed from both
references and string paths.

Fixes angular#1337
@davideast

Copy link
Copy Markdown
Collaborator

YES! @Maistho THANK YOU SO MUCH!

Give me a bit and I'll give this a proper review.

@davideast

Copy link
Copy Markdown
Collaborator

LOOKS PERFECT! Thank you so much @Maistho!

@davideast davideast left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOVE IT.

@davideast
davideast merged commit 136f1e5 into angular:master Mar 7, 2018
@Maistho

Maistho commented Mar 7, 2018

Copy link
Copy Markdown
Contributor Author

Sweet! ♥️

@Maistho
Maistho deleted the issue-1337-firestore-from-ref branch March 7, 2018 13:37
myspivey pushed a commit to myspivey/angularfire2 that referenced this pull request Apr 10, 2018
Allows firestore collection and doc to be constructed from both
references and string paths.

Fixes angular#1337
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants