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 a292b78 commit dcb6be809b501a404c90ec58ddffa47c2ce0b67b
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 { ModalController, ViewController } from 'ionic-angular';
import { NewLocationMessageComponent } from './location-message';
import { MessageType } from 'api/models';
@Component({
selector: 'messages-attachments',
@@ -10,4 +12,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 dcb6be8

Please sign in to comment.