Permalink
Browse files

Step 2.18: Implement removeChat method

  • Loading branch information...
dotansimha authored and darkbasic committed Jan 24, 2017
1 parent 93015e0 commit 6e80ea539cc2ec937e73e08bda4b9fd7d88dc85c
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 6e80ea5

Please sign in to comment.