11import { Injectable } from '@angular/core' ;
22import { storage } from 'firebase/app' ;
3- import 'firebase/storage' ;
43import { FirebaseApp } from 'angularfire2' ;
5- import { AngularFireStorageRef } from './ref' ;
6- import { AngularFireUploadTask } from './task' ;
4+ import { createStorageRef } from './ref' ;
5+ import { createUploadTask } from './task' ;
6+ import { Observable } from 'rxjs/Observable' ;
77
8+ /**
9+ * AngularFireStorage Service
10+ *
11+ * This service is the main entry point for this feature module. It provides
12+ * an API for uploading and downloading binary files from Cloud Storage for
13+ * Firebase.
14+ *
15+ */
816@Injectable ( )
917export class AngularFireStorage {
1018 storage : storage . Storage ;
@@ -14,12 +22,12 @@ export class AngularFireStorage {
1422 }
1523
1624 ref ( path : string ) {
17- return new AngularFireStorageRef ( this . storage . ref ( path ) ) ;
25+ return createStorageRef ( this . storage . ref ( path ) ) ;
1826 }
1927
20- upload ( pathOrRef : string , data : any , metadata ?: storage . UploadMetadata ) {
21- const storageRef = this . storage . ref ( pathOrRef ) ;
22- const ref = new AngularFireStorageRef ( storageRef ) ;
28+ upload ( path : string , data : any , metadata ?: storage . UploadMetadata ) {
29+ const storageRef = this . storage . ref ( path ) ;
30+ const ref = createStorageRef ( storageRef ) ;
2331 return ref . put ( data , metadata ) ;
2432 }
2533
0 commit comments