File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { Component } from '@angular/core';
22import { ModalController , ViewController } from 'ionic-angular' ;
33import { NewLocationMessageComponent } from './location-message' ;
44import { MessageType } from 'api/models' ;
5+ import { PictureService } from '../../services/picture' ;
56
67@Component ( {
78 selector : 'messages-attachments' ,
@@ -10,9 +11,19 @@ import { MessageType } from 'api/models';
1011export class MessagesAttachmentsComponent {
1112 constructor (
1213 private viewCtrl : ViewController ,
13- private modelCtrl : ModalController
14+ private modelCtrl : ModalController ,
15+ private pictureService : PictureService
1416 ) { }
1517
18+ sendPicture ( ) : void {
19+ this . pictureService . select ( ) . then ( ( file : File ) => {
20+ this . viewCtrl . dismiss ( {
21+ messageType : MessageType . PICTURE ,
22+ selectedPicture : file
23+ } ) ;
24+ } ) ;
25+ }
26+
1627 sendLocation ( ) : void {
1728 const locationModal = this . modelCtrl . create ( NewLocationMessageComponent ) ;
1829 locationModal . onDidDismiss ( ( location ) => {
You can’t perform that action at this time.
0 commit comments