1

I want to count the total data in a users profile in my firebase. Therefore I first get the profile as object:

var profile = $firebase(ref.child('profile').child(userId)).$asObject();

Now If I console.log this var there is this object:

enter image description here

I found some solutions to count the object with

console.log(Object.keys(profile));

But this gives me only the count 3. always:

enter image description here

Anyone got a solution how I can get the count of the data stored? There should be age, gender, place, realname, username = 5

3
  • Try with profile.$loaded.then(function(data) {console.log(data);}); Commented Oct 31, 2014 at 8:24
  • you rock. thanks. Post this as an answer and explain a little so i can accept it ;) Commented Oct 31, 2014 at 8:31
  • possible duplicate of Firebase angularfire child.$asObject give properties undefined Commented Oct 31, 2014 at 13:34

1 Answer 1

1

Try with

profile.$loaded.then(function(data) {
    console.log(data);
}); 

Take a look at the first comment in this post

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.