Permalink
Browse files

Step 8.7: Added addChat method

  • Loading branch information...
dotansimha authored and darkbasic committed Jan 24, 2017
1 parent 65558f8 commit 0dcfa86dc0a49b2bfc860b1f0a7e4697c085af81
Showing with 10 additions and 2 deletions.
  1. +10 −2 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'
@@ -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() {
@@ -35,6 +42,7 @@ export class ChatsPage implements OnInit {
).zone();
}


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

0 comments on commit 0dcfa86

Please sign in to comment.