Skip to content

Commit

Permalink
Step 4.21: Implement remove chat with the Collection
Browse files Browse the repository at this point in the history
  • Loading branch information
darkbasic committed Oct 16, 2017
1 parent 9e52e87 commit 81f4720
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/pages/chats/chats.ts
Original file line number Diff line number Diff line change
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 81f4720

Please sign in to comment.