Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Step 7.36: Added showOptions method
  • Loading branch information
dotansimha authored and DAB0mB committed Mar 23, 2017
1 parent f652cee commit 35132b2
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/pages/chats/chats.ts
@@ -1,17 +1,20 @@
import { Component, OnInit } from '@angular/core';
import { Chats, Messages } from 'api/collections';
import { Chat } from 'api/models';
import { NavController } from 'ionic-angular';
import { NavController, PopoverController } from 'ionic-angular';
import { Observable } from 'rxjs';
import { MessagesPage } from '../messages/messages';
import { ChatsOptionsComponent } from './chats-options';

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

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

ngOnInit() {
Expand Down Expand Up @@ -40,4 +43,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 35132b2

Please sign in to comment.