Skip to content

Commit

Permalink
Step 4.22: Implement remove chat with the Collection
Browse files Browse the repository at this point in the history
  • Loading branch information
darkbasic committed Jun 13, 2017
1 parent 3e87609 commit f4b31d8
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/pages/chats/chats.ts
Expand Up @@ -31,13 +31,7 @@ export class ChatsPage implements OnInit {
}

removeChat(chat: Chat): void {
this.chats = this.chats.map((chatsArray: Chat[]) => {
const chatIndex = chatsArray.indexOf(chat);
if (chatIndex !== -1) {
chatsArray.splice(chatIndex, 1);
}

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

0 comments on commit f4b31d8

Please sign in to comment.