Skip to content

Commit

Permalink
Step 4.1: Added showMessage method
Browse files Browse the repository at this point in the history
  • Loading branch information
dotansimha authored and DAB0mB committed Dec 24, 2016
1 parent 193fc9d commit 219b619
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/pages/chats/chats.ts
Expand Up @@ -2,14 +2,15 @@ import { Component, OnInit } from '@angular/core';
import { Observable } from "rxjs";
import { Chat } from "api/models/whatsapp-models";
import { Chats, Messages } from "api/collections/whatsapp-collections";
import { NavController } from "ionic-angular";

@Component({
templateUrl: 'chats.html'
})
export class ChatsPage implements OnInit {
chats;

constructor() {
constructor(private navCtrl: NavController) {

}

Expand All @@ -31,6 +32,10 @@ export class ChatsPage implements OnInit {
).zone();
}

showMessages(chat): void {
this.navCtrl.push(MessagesPage, {chat});
}

removeChat(chat: Chat): void {
this.chats = this.chats.map<Chat[]>(chatsArray => {
const chatIndex = chatsArray.indexOf(chat);
Expand Down

0 comments on commit 219b619

Please sign in to comment.