Permalink
Browse files

Step 13.8: Implement sendPicture method

  • Loading branch information...
dotansimha authored and darkbasic committed Jan 24, 2017
1 parent 7663f0a commit fd56e133a1385d3c0c40b86c3c1e4da8b0974a71
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 { ModalController, ViewController } from 'ionic-angular';
import { NewLocationMessageComponent } from './location-message';
import { MessageType } from 'api/models';
import { PictureService } from '../../services/picture';
@Component({
selector: 'messages-attachments',
@@ -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) => {

0 comments on commit fd56e13

Please sign in to comment.