Skip to content

Commit

Permalink
Step 13.7: Implement sendPicture method
Browse files Browse the repository at this point in the history
  • Loading branch information
dotansimha authored and darkbasic committed Jun 13, 2017
1 parent e327176 commit 90582ba
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/pages/messages/messages-attachments.ts
Expand Up @@ -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',
Expand All @@ -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) => {
Expand Down

0 comments on commit 90582ba

Please sign in to comment.