Jose Zamudio
Jose Zamudio

Reputation: 865

Getting unique id in firebase

I am using firebase for a project and I am trying to get all of my objects from the database, I am running this piece of code to get them:

var ref = new Firebase("https://<fire-base-database>.firebaseio.com/games");
$scope.games = $firebaseArray(ref);

I am getting the objects correctly but when I try to access their ID's with .$id I am not getting any data back...

Is there any way of getting the object unique id (which looks something like JlTq-W2RtWpOuKb2_Gp)? I need it to show the detail view of the item when someone clicks on it.

Thank you in advance!

Upvotes: 1

Views: 1127

Answers (1)

Jose Zamudio
Jose Zamudio

Reputation: 865

I managed to solve this by getting the key in the ng-repeat like (key, games) in games and it gave me access the key.

Upvotes: 5

Related Questions