11import { Injectable } from '@angular/core' ;
22import { AngularFire , AngularFireDatabase , FirebaseListObservable } from 'angularfire2' ;
3- import * as firebase from 'firebase' ;
43import { Upload } from './upload' ;
5- import * as _ from "lodash" ;
4+ import * as firebase from 'firebase' ;
5+
66
77@Injectable ( )
88export class UploadService {
@@ -21,18 +21,6 @@ export class UploadService {
2121 return this . uploads
2222 }
2323
24- singleUpload ( file : File ) {
25- let upload = new Upload ( file ) ;
26- this . pushUpload ( upload )
27- }
28-
29-
30- multiUpload ( files :FileList ) {
31- let filesIndex = _ . range ( files . length )
32- _ . each ( filesIndex , ( idx ) => {
33- this . singleUpload ( files [ idx ] ) }
34- )
35- }
3624
3725 deleteUpload ( upload : Upload ) {
3826 this . deleteFileData ( upload . $key )
@@ -43,7 +31,7 @@ export class UploadService {
4331 }
4432
4533 // Executes the file uploading to firebase https://firebase.google.com/docs/storage/web/upload-files
46- private pushUpload ( upload : Upload ) {
34+ pushUpload ( upload : Upload ) {
4735 let storageRef = firebase . storage ( ) . ref ( ) ;
4836 this . uploadTask = storageRef . child ( `${ this . basePath } /${ upload . file . name } ` ) . put ( upload . file ) ;
4937
0 commit comments