2014-10-31 3 views
0

내 firebase에있는 사용자 프로필의 총 데이터를 계산하고 싶습니다. enter image description hereAngularFire에서 하위 데이터를 가져옵니다.

내가

와 객체를 계산하는 몇 가지 해결책을 발견 :이이 객체가 VAR CONSOLE.LOG 경우 지금

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

을 : 그러므로 내가 첫째 대상으로 프로파일을 얻을

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

그러나 이것은 항상 3을 제공합니다. 항상 :

enter image description here

아무도 데이터 저장 횟수를 얻을 수있는 해결책이 있습니까? 이 있어야 연령, 성별, 장소, realname, 사용자 이름 = 5

+0

최초의 코멘트에서 봐

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

으로 시도 (function (data) {console.log (data);}); – Whisher

+0

당신이 흔들립니다. 감사. 이것을 대답으로 게시하고 조금 설명하면 받아 들일 수 있습니다.) – m1crdy

+0

[Firebase anglefire 하위. $ asObject는 정의되지 않은 속성을 제공합니다.] (http://stackoverflow.com/questions/26604472/firebase-angularfire-child- asobject-give-properties-undefined) –

답변

1

프로필. $의 loaded.then으로 시도이 post

관련 문제