JS CODE
var myFirebaseRef = new Firebase('https://blinding-inferno-7068.firebaseio.com/');
var createdUserRef = myFirebaseRef.child('users').child('createdUser');
$scope.users = $firebaseArray(createdUserRef);
HTML CODE
<ul ng-repeat="user in users">
<li>{{user.uid}}</li>
<li>{{user.email}}</li>
<li>{{user}}</li>
</ul>
What I wanted was user.uid and user.email, but those thing didn't come out. So I checked the user object, and these things came out.
{"-Js0q1mWTwK-AZDZyVdc":{"email":"[email protected]","uid":"simplelogin:11"},"$id":"simplelogin:11","$priority":null}
How can I retrieve the key's value? (I mean email's value and uid's value)
Should I have to retrieve that data by putting code like this?
{{user.-Js0q1mWtwk-AZDZyVdc.email}}
like this ? horrible.
Please help me T_T..
Let's have a look at your actual data:
new Firebase('https://blinding-inferno-7068.firebaseio.com/').once('value', function(s) { console.log(JSON.stringify(s.val())); }, function(e) { console.error(e); })
or by looking at the Data tab in the dashboard of your application.*Your
$firebaseArray
contains objects such as this:And there is no child
email
undersimplelogin:11
. So that's why you're not seeing that output.It looks like you accidentally are adding the users with a
$add
operation, which creates the"-Js0q1mWTwK-AZDZyVdc"
in the sample above. You should instead be using$save
or just by using the regular Firebase JavaScript SDK:Note that it is a bit tricky to explain without seeing the code you use to create those users. So if you edit your question to include that code, I'll update my answer.