Skip to content

Commit 10d73b1

Browse files
dotansimhadarkbasic
authored andcommitted
Step 9.8: Implemente showOptions method
1 parent 1214433 commit 10d73b1

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/pages/messages/messages.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import { Component, OnInit, OnDestroy, ElementRef } from '@angular/core';
2-
import { NavParams } from 'ionic-angular';
2+
import { NavParams, PopoverController } from 'ionic-angular';
33
import { Chat, Message, MessageType } from 'api/models';
44
import { Messages } from 'api/collections';
55
import { MeteorObservable } from 'meteor-rxjs';
66
import * as moment from 'moment';
77
import * as _ from 'lodash';
8+
import { MessagesOptionsComponent } from './messages-options';
89

910
@Component({
1011
selector: 'messages-page',
@@ -22,7 +23,8 @@ export class MessagesPage implements OnInit, OnDestroy {
2223

2324
constructor(
2425
navParams: NavParams,
25-
private el: ElementRef
26+
private el: ElementRef,
27+
private popoverCtrl: PopoverController
2628
) {
2729
this.selectedChat = <Chat>navParams.get('chat');
2830
this.title = this.selectedChat.title;
@@ -56,6 +58,16 @@ export class MessagesPage implements OnInit, OnDestroy {
5658
this.messagesDayGroups = this.findMessagesDayGroups();
5759
}
5860

61+
showOptions(): void {
62+
const popover = this.popoverCtrl.create(MessagesOptionsComponent, {
63+
chat: this.selectedChat
64+
}, {
65+
cssClass: 'options-popover messages-options-popover'
66+
});
67+
68+
popover.present();
69+
}
70+
5971
findMessagesDayGroups() {
6072
return Messages.find({
6173
chatId: this.selectedChat._id

0 commit comments

Comments
 (0)