Permalink
Browse files

Step 12.17: Implement the sendLocation message to display the new loc…

…ation modal
  • Loading branch information...
dotansimha authored and darkbasic committed Jan 24, 2017
1 parent 152699c commit 6cf6af805c95e3ef7b2a588ce17ee4ce97f1c40d
Showing with 20 additions and 0 deletions.
  1. +20 −0 src/pages/messages/messages-attachments.ts
@@ -1,5 +1,7 @@
import { Component } from '@angular/core';
import { AlertController, Platform, ModalController, ViewController } from 'ionic-angular';
import { NewLocationMessageComponent } from './location-message';
import { MessageType } from 'api/models';
@Component({
selector: 'messages-attachments',
@@ -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 6cf6af8

Please sign in to comment.