Skip to content

Commit

Permalink
Step 7.35: Added showOptions method
Browse files Browse the repository at this point in the history
  • Loading branch information
DAB0mB committed Feb 26, 2017
1 parent 410fd6f commit 3122f38
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions client/imports/pages/chats/chats.ts
@@ -1,9 +1,10 @@
import { Component, OnInit } from '@angular/core';
import { NavController } from 'ionic-angular';
import { NavController, PopoverController } from 'ionic-angular';
import * as Moment from 'moment';
import { Observable } from 'rxjs';
import { Chats, Messages } from '../../../../imports/collections';
import { Chat, MessageType } from '../../../../imports/models';
import { ChatsOptionsComponent } from './chats-options';
import { MessagesPage } from '../messages/messages';
import template from './chats.html';

Expand All @@ -13,7 +14,9 @@ import template from './chats.html';
export class ChatsPage implements OnInit {
chats;

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

ngOnInit() {
Expand Down Expand Up @@ -42,4 +45,12 @@ export class ChatsPage implements OnInit {
Chats.remove({_id: chat._id}).subscribe(() => {
});
}

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

popover.present();
}
}

0 comments on commit 3122f38

Please sign in to comment.