You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Same problem as @corneezius. Also, can anyone explain this code, please? I know it tries to join both Chats and Messages collections, but... it's().kindOf().tooMuch(nested => isn't.it())?
there is this peace of code in the tutorial (step 3) :
ngOnInit() { this.chats = Chats .find({}) .mergeMap((chats: Chat[]) => Observable.combineLatest( ...chats.map((chat: Chat) => Messages .find({chatId: chat._id}) .startWith(null) .map(messages => { if (messages) chat.lastMessage = messages[0]; return chat; }) ) ) ).zone(); }
I solved some erros in my code adding this minor details :
ngOnInit() { this.chats = Chats .find({}) .mergeMap((chats: Chat[]) => { return Observable.combineLatest( ...chats.map((chat: Chat) => Messages .find({chatId: chat._id}) .startWith(null) .map(messages => { if (messages) chat.lastMessage = messages[0]; return chat; }) ) )} ).zone(); }
infact just add a return on the Observable.combineLatest(...)
The text was updated successfully, but these errors were encountered: