Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

return the $id of the added object when calling add() on angularFireCollection #26

Closed

Conversation

jeffreywescott
Copy link

TL;DR: Bring the semantics of angularFireCollection.add() a bit closer to that of Firebase.push().

This change set allows you to reference the added object by it's uniquely-generated (by Firebase) $id. This can be useful, for example, if one controller adds a new object and then passes control to another controller that wants to pull that object out of firebase using its $id.

@jeffreywescott
Copy link
Author

I'd be okay with the ref, too. But that seems a bit like mixing metaphors to me. Still, that would work for my purposes.

Here's an example of code that uses it: https://github.com/binaryfeed/tictactoe-angularjs-firebase

@facultymatt
Copy link

+1 this is a much needed feature.

@efflam
Copy link

efflam commented May 21, 2013

+1

1 similar comment
@BirdInTheCity
Copy link

+1

@anantn
Copy link
Contributor

anantn commented Jun 6, 2013

Fixed in bfb831c

We return the ref of the object when you call angularFireCollection.add(). You can access the ID of the object via ref.name().

@anantn anantn closed this Jun 6, 2013
@scottsword
Copy link

Yes!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants