Skip to content

Commit 2ee3c04

Browse files
dotansimhadarkbasic
authored andcommitted
Step 6.1: Add showMessages
1 parent d3b42d4 commit 2ee3c04

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/pages/chats/chats.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Component, OnInit } from '@angular/core';
22
import { Chats, Messages } from 'api/collections';
33
import { Chat } from 'api/models';
4+
import { NavController } from 'ionic-angular';
45
import { Observable } from 'rxjs';
56

67
@Component({
@@ -9,7 +10,7 @@ import { Observable } from 'rxjs';
910
export class ChatsPage implements OnInit {
1011
chats;
1112

12-
constructor() {
13+
constructor(private navCtrl: NavController) {
1314
}
1415

1516
ngOnInit() {
@@ -30,6 +31,10 @@ export class ChatsPage implements OnInit {
3031
).zone();
3132
}
3233

34+
showMessages(chat): void {
35+
this.navCtrl.push(MessagesPage, {chat});
36+
}
37+
3338
removeChat(chat: Chat): void {
3439
Chats.remove({_id: chat._id}).subscribe(() => {
3540
});

0 commit comments

Comments
 (0)