Skip to content

Commit

Permalink
Step 7.36: Added showOptions method
Browse files Browse the repository at this point in the history
  • Loading branch information
dotansimha authored and darkbasic committed Oct 16, 2017
1 parent 81270f5 commit 6ddddf9
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/pages/chats/chats.ts
Original file line number Diff line number Diff line change
@@ -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 6ddddf9

Please sign in to comment.