Skip to content

Commit

Permalink
Step 8.7: Added addChat method
Browse files Browse the repository at this point in the history
  • Loading branch information
dotansimha authored and darkbasic committed Oct 16, 2017
1 parent 65558f8 commit 0dcfa86
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/pages/chats/chats.ts
@@ -1,10 +1,11 @@
import { Component, OnInit } from '@angular/core';
import { Chats, Messages } from 'api/collections';
import { Chat } from 'api/models';
import { NavController, PopoverController } from 'ionic-angular';
import { NavController, PopoverController, ModalController } from 'ionic-angular';
import { Observable } from 'rxjs';
import { MessagesPage } from '../messages/messages';
import { ChatsOptionsComponent } from './chats-options';
import { NewChatComponent } from './new-chat';

@Component({
templateUrl: 'chats.html'
Expand All @@ -14,7 +15,13 @@ export class ChatsPage implements OnInit {

constructor(
private navCtrl: NavController,
private popoverCtrl: PopoverController) {
private popoverCtrl: PopoverController,
private modalCtrl: ModalController) {
}

addChat(): void {
const modal = this.modalCtrl.create(NewChatComponent);
modal.present();
}

ngOnInit() {
Expand All @@ -35,6 +42,7 @@ export class ChatsPage implements OnInit {
).zone();
}


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

0 comments on commit 0dcfa86

Please sign in to comment.