Permalink
Browse files

Step 2.18: Implement removeChat method

  • Loading branch information...
dotansimha authored and darkbasic committed Jan 24, 2017
1 parent 9acc010 commit 4a9cf27ba36560c2ab7fbc5ba5474b91f683ad52
Showing with 11 additions and 0 deletions.
  1. +11 −0 src/pages/chats/chats.ts
View
@@ -67,4 +67,15 @@ export class ChatsPage {
}
]);
}
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;
});
}
}

0 comments on commit 4a9cf27

Please sign in to comment.