Skip to content

Commit

Permalink
Step 13.8: Implement sendPicture method
Browse files Browse the repository at this point in the history
  • Loading branch information
dotansimha authored and darkbasic committed Oct 16, 2017
1 parent 7663f0a commit fd56e13
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/pages/messages/messages-attachments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Component } from '@angular/core';
import { 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 @@ -10,9 +11,19 @@ import { MessageType } from 'api/models';
export class MessagesAttachmentsComponent {
constructor(
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 fd56e13

Please sign in to comment.