File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import { BillProvider } from '../providers/bill/bill';
1313import { AngularFireModule } from 'angularfire2' ;
1414import { AngularFireDatabaseModule } from 'angularfire2/database' ;
1515import { AngularFireAuthModule } from 'angularfire2/auth' ;
16- // import { AngularFireStorageModule } from 'angularfire2/storage';
16+ import { AngularFireStorageModule } from 'angularfire2/storage' ;
1717import { firebaseConfig } from './credentials' ;
1818
1919class CameraMock extends Camera {
@@ -39,8 +39,8 @@ class CameraMock extends Camera {
3939 IonicModule . forRoot ( MyApp ) ,
4040 AngularFireModule . initializeApp ( firebaseConfig ) ,
4141 AngularFireAuthModule ,
42- AngularFireDatabaseModule
43- // AngularFireStorageModule
42+ AngularFireDatabaseModule ,
43+ AngularFireStorageModule
4444 ] ,
4545 bootstrap : [ IonicApp ] ,
4646 entryComponents : [
Original file line number Diff line number Diff line change 88 </ ion-buttons >
99 </ ion-navbar >
1010</ ion-header >
11-
1211< ion-content padding >
13- <!--
1412 < img [src] ="bill?.picture || placeholderPicture " (click) ="uploadPicture() " />
1513 < span *ngIf ="!bill?.picture ">
1614 Click the image to upload a picture of your debt/bill
1715 </ span >
18- -->
19-
2016 < ion-card >
2117 < ion-card-header >
2218 Debt Information
Original file line number Diff line number Diff line change 66 ActionSheet ,
77 ActionSheetController ,
88 Platform ,
9- //Alert,
10- AlertController
9+ Alert ,
10+ AlertController ,
11+ Platform
1112} from 'ionic-angular' ;
1213import { BillProvider } from '../../providers/bill/bill' ;
1314import { AuthProvider } from '../../providers/auth/auth' ;
@@ -80,7 +81,6 @@ export class BillDetailPage {
8081 action . present ( ) ;
8182 }
8283
83- /***
8484 uploadPicture ( billId ) : void {
8585 if ( this . authProvider . getUser ( ) . isAnonymous == true ) {
8686 const alert : Alert = this . alertCtrl . create ( {
@@ -97,6 +97,7 @@ export class BillDetailPage {
9797 } ) ;
9898 alert . present ( ) ;
9999 } else {
100+ if ( this . platform . is ( 'android' ) || this . platform . is ( 'ios' ) ) {
100101 this . cameraPlugin
101102 . getPicture ( {
102103 quality : 95 ,
@@ -119,8 +120,10 @@ export class BillDetailPage {
119120 console . log ( 'ERROR -> ' + JSON . stringify ( error ) ) ;
120121 }
121122 ) ;
123+ } else {
124+ this . billProvider . storeDownloadUrl ( this . billId , '../assets/img/logo.jpg' )
125+ }
122126 }
123127 }
124- ***/
125128
126129}
Original file line number Diff line number Diff line change @@ -5,13 +5,13 @@ import {
55 AngularFireObject ,
66 AngularFireList
77} from 'angularfire2/database' ;
8- /****
8+
99import {
1010 AngularFireStorage ,
1111 AngularFireStorageReference ,
1212 AngularFireUploadTask
1313} from 'angularfire2/storage' ;
14- ***/
14+
1515import firebase from 'firebase/app' ;
1616
1717@Injectable ( )
@@ -65,7 +65,6 @@ export class BillProvider {
6565 return this . billList . update ( billId , { paid : true } ) ;
6666 }
6767
68- /***
6968 takeBillPhoto ( billId : string , imageURL : string ) : AngularFireUploadTask {
7069 const storageRef : AngularFireStorageReference = this . afStorage . ref (
7170 `${ this . userId } /${ billId } /billPicture/`
@@ -75,7 +74,6 @@ export class BillProvider {
7574 contentType : 'image/png'
7675 } ) ;
7776 }
78- ***/
7977
8078 storeDownloadUrl ( billId : string , downloadUrl : string ) : Promise < any > {
8179 console . log ( billId , downloadUrl ) ;
You can’t perform that action at this time.
0 commit comments