joaogarin / angular-electron

Angular2 and Electron starter using webpack
150 stars 53 forks source link

Friend System #74

Closed Nebula-Spark closed 7 years ago

Nebula-Spark commented 7 years ago

I know its not the right place to ask this question but maybe here i can find some solution, I am just Stucked @ friend system using Angularfire2 especially how to find my friends status whether they online or offline

My Db is like

Profile- MARIO: name: mario friends: PRINCE: true status:online

    PRINCE:
        name:prince
        friends: 
                MARIO : true
        status:offline

Now I want to find profile array to check if my Key exists on their friends objects return all those lists So i can ngFor those value and view it on the UI

Using map Operator let key = MARIO this.Online = this.af.list('profile').map( USERS => {

const Filter = USERS.filter( PROFILE => PROFILE.friends == key) ) return Filter

} )

this.Online.subscribe( RES => console.log( RES) )

But the problem is The code is not working i know something wrong here , It would be great If any 1 can give me a solution to this ! Or I need to Approach it differently ?

joaogarin commented 7 years ago

Hello,

perhaps you try https://github.com/angular/angularfire2 this is not really related to angularfire2 this repo.

Cant really help on that sorry :/