Skip to content

Commit

Permalink
Step 5.35: Use the popover component
Browse files Browse the repository at this point in the history
  • Loading branch information
dotansimha authored and DAB0mB committed Feb 26, 2017
1 parent 639fbbb commit 26f63c7
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/pages/chats/chats.ts
Expand Up @@ -2,16 +2,17 @@ import { Component, OnInit } from '@angular/core';
import { Observable } from "rxjs";
import { Chat } from "api/models/whatsapp-models";
import { Chats, Messages } from "api/collections/whatsapp-collections";
import { NavController } from "ionic-angular";
import { NavController, PopoverController } from "ionic-angular";
import { MessagesPage } from "../messages/messages";
import { ChatsOptionsComponent } from "../chat-options/chat-options";

@Component({
templateUrl: 'chats.html'
})
export class ChatsPage implements OnInit {
chats;

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

}

Expand All @@ -33,6 +34,14 @@ export class ChatsPage implements OnInit {
).zone();
}

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

popover.present();
}

showMessages(chat): void {
this.navCtrl.push(MessagesPage, {chat});
}
Expand Down

0 comments on commit 26f63c7

Please sign in to comment.