Ionic 2 + firebase

HI! The question seems irrelevant to ionic 2, but i would appreciate if somebody who work with firebase can give me a hand. I am trying to read the value from firebase and assign it to a global variable but it didn’t work.

public points: any;

readPoints(): any{
    this.userProfile.child(this.user.uid).once('value').then((snapshot) =>{
        this.points = snapshot.val().user_points;
    });

}

any way to assign value from firebase to variable?

What error are you getting, because that’s the exact way you fetch from the database and assign to the view.

I’d check that you’re sending the actual user’s UID here: .child(this.user.uid)