Skip to content

Commit

Permalink
Step 12.6: Implement sendPicture method
Browse files Browse the repository at this point in the history
  • Loading branch information
dotansimha authored and DAB0mB committed Feb 26, 2017
1 parent f3987a0 commit b7e4b6d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion client/imports/pages/messages/messages-attachments.ts
@@ -1,5 +1,6 @@
import { Component } from '@angular/core';
import { AlertController, Platform, ModalController, ViewController } from 'ionic-angular';
import { PictureService } from '../../services/picture';
import { MessageType } from '../../../../imports/models';
import { NewLocationMessageComponent } from './location-message';
import template from './messages-attachments.html';
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 b7e4b6d

Please sign in to comment.