Skip to content

Commit

Permalink
Step 4.20: Implement remove chat with the Collection
Browse files Browse the repository at this point in the history
  • Loading branch information
dotansimha authored and DAB0mB committed Feb 13, 2017
1 parent 5eebea1 commit 7823abf
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/pages/chats/chats.ts
Expand Up @@ -31,11 +31,7 @@ export class ChatsPage implements OnInit {
}

removeChat(chat: Chat): void {
this.chats = this.chats.map(chatsArray => {
const chatIndex = chatsArray.indexOf(chat);
chatsArray.splice(chatIndex, 1);

return chatsArray;
Chats.remove({_id: chat._id}).subscribe(() => {
});
}
}

0 comments on commit 7823abf

Please sign in to comment.