Skip to content

Commit

Permalink
Step 11.17: Implement the sendLocation message to display the new loc…
Browse files Browse the repository at this point in the history
…ation modal
  • Loading branch information
dotansimha authored and DAB0mB committed Feb 13, 2017
1 parent f9e641b commit 096ba5d
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions client/imports/pages/messages/messages-attachments.ts
@@ -1,5 +1,7 @@
import { Component } from '@angular/core';
import { AlertController, Platform, ModalController, ViewController } from 'ionic-angular';
import { MessageType } from '../../../../imports/models';
import { NewLocationMessageComponent } from './location-message';
import template from './messages-attachments.html';

@Component({
Expand All @@ -12,4 +14,22 @@ export class MessagesAttachmentsComponent {
private viewCtrl: ViewController,
private modelCtrl: ModalController
) {}

sendLocation(): void {
const locationModal = this.modelCtrl.create(NewLocationMessageComponent);
locationModal.onDidDismiss((location) => {
if (!location) {
this.viewCtrl.dismiss();

return;
}

this.viewCtrl.dismiss({
messageType: MessageType.LOCATION,
selectedLocation: location
});
});

locationModal.present();
}
}

0 comments on commit 096ba5d

Please sign in to comment.