Skip to content
Permalink
Browse files

Step 7.7: Define component's method to open options

  • Loading branch information...
dotansimha authored and DAB0mB committed Nov 3, 2016
1 parent 3f0c8f9 commit 8edf32eabda84a8f08b5f8506b77d15f347bae33
Showing with 13 additions and 3 deletions.
  1. +13 −3 src/pages/messages/messages.ts
@@ -1,9 +1,10 @@
import {Component, OnInit, OnDestroy, ElementRef} from "@angular/core";
import { NavParams } from "ionic-angular";
import { Component, OnInit, OnDestroy, ElementRef } from "@angular/core";
import { NavParams, PopoverController } from "ionic-angular";
import { Chat, Message } from "api/models/whatsapp-models";
import { Messages } from "api/collections/whatsapp-collections";
import { Observable } from "rxjs";
import { MeteorObservable } from "meteor-rxjs";
import { MessagesOptionsComponent } from "../messages-options/messages-options";

@Component({
selector: "messages-page",
@@ -18,12 +19,21 @@ export class MessagesPage implements OnInit, OnDestroy {
autoScroller: MutationObserver;
senderId: string;

constructor(navParams: NavParams, element: ElementRef) {
constructor(navParams: NavParams, element: ElementRef, public popoverCtrl: PopoverController) {
this.selectedChat = <Chat>navParams.get('chat');
this.title = this.selectedChat.title;
this.picture = this.selectedChat.picture;
this.senderId = Meteor.userId();
}

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

popover.present();
}

private get messagesPageContent(): Element {

0 comments on commit 8edf32e

Please sign in to comment.
You can’t perform that action at this time.