0
user_properties
이 내 함수 외부에 있다고 선언합니다. 그런 다음 firebase에서 데이터를 가져와 user_properties에 저장하려고 시도하지만 정의되지 않은 상태가됩니다.변수가 함수 내에서 업데이트 될 때 정의되지 않음
내가 잘못하고있는 것을 아는 사람이 있습니까?
var user_properties;
get_user_properties = new Firebase("https://<MY-URL>/users/"+auth.uid+"/properties");
get_user_properties.once('value', function (dataSnapshot) {
user_properties = dataSnapshot.val();
});
//undefined
console.log(user_properties);
기능은 비동기로
–