Skip to content

Commit

Permalink
Step 6.1: Add showMessages
Browse files Browse the repository at this point in the history
  • Loading branch information
dotansimha authored and darkbasic committed Jun 13, 2017
1 parent 793b520 commit d21f501
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/pages/chats/chats.ts
@@ -1,6 +1,7 @@
import { Component, OnInit } from '@angular/core';
import { Chats, Messages } from 'api/collections';
import { Chat } from 'api/models';
import { NavController } from 'ionic-angular';
import { Observable } from 'rxjs';

@Component({
Expand All @@ -9,7 +10,7 @@ import { Observable } from 'rxjs';
export class ChatsPage implements OnInit {
chats;

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

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

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

removeChat(chat: Chat): void {
Chats.remove({_id: chat._id}).subscribe(() => {
});
Expand Down

0 comments on commit d21f501

Please sign in to comment.