Permalink
Browse files

Step 8.7: Added addChat method

  • Loading branch information...
dotansimha authored and darkbasic committed Jan 24, 2017
1 parent 87b5c87 commit 0af89ddfca1db8e8dd911879aa9132dd0baecfac
Showing with 10 additions and 2 deletions.
  1. +10 −2 src/pages/chats/chats.ts
View
@@ -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 0af89dd

Please sign in to comment.