Skip to content

Commit

Permalink
Step 6.1: Add 'addChat' method to ChatsComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilkisiela authored and DAB0mB committed Feb 26, 2017
1 parent d2920a0 commit a97e3e0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions client/imports/pages/chats/chats.component.ts
Expand Up @@ -7,9 +7,10 @@ import style from "./chats.component.scss";
import {Chats} from "../../../../both/collections/chats.collection";
import {Message} from "../../../../both/models/message.model";
import {Messages} from "../../../../both/collections/messages.collection";
import {NavController, PopoverController} from "ionic-angular";
import {NavController, PopoverController, ModalController} from "ionic-angular";
import {MessagesPage} from "../chat/messages-page.component";
import {ChatsOptionsComponent} from '../chats/chats-options.component';
import {NewChatComponent} from './new-chat.component';

@Component({
selector: "chats",
Expand All @@ -23,7 +24,8 @@ export class ChatsComponent implements OnInit {

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

ngOnInit() {
Expand All @@ -45,6 +47,11 @@ export class ChatsComponent implements OnInit {
).zone();
}

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

showOptions(): void {
const popover = this.popoverCtrl.create(ChatsOptionsComponent, {}, {
cssClass: 'options-popover'
Expand Down

0 comments on commit a97e3e0

Please sign in to comment.