Permalink
Browse files

Step 13.7: Implement sendPicture method

  • Loading branch information...
dotansimha authored and darkbasic committed Jan 24, 2017
1 parent e327176 commit 90582ba67d36f4f66fbaa268af3d61a08de6d52d
Showing with 12 additions and 1 deletion.
  1. +12 −1 src/pages/messages/messages-attachments.ts
@@ -2,6 +2,7 @@ import { Component } from '@angular/core';
import { AlertController, Platform, ModalController, ViewController } from 'ionic-angular';
import { NewLocationMessageComponent } from './location-message';
import { MessageType } from 'api/models';
import { PictureService } from '../../services/picture';
@Component({
selector: 'messages-attachments',
@@ -12,9 +13,19 @@ export class MessagesAttachmentsComponent {
private alertCtrl: AlertController,
private platform: Platform,
private viewCtrl: ViewController,
private modelCtrl: ModalController
private modelCtrl: ModalController,
private pictureService: PictureService
) {}
sendPicture(): void {
this.pictureService.select().then((file: File) => {
this.viewCtrl.dismiss({
messageType: MessageType.PICTURE,
selectedPicture: file
});
});
}
sendLocation(): void {
const locationModal = this.modelCtrl.create(NewLocationMessageComponent);
locationModal.onDidDismiss((location) => {

0 comments on commit 90582ba

Please sign in to comment.