在 app.module 中
AngularFireModule.initializeApp(environment.firebaseConfig)
我有两个存储
firebaseConfig: {
apiKey: 'AIzaSyBHsAxVgiuM0_xLd3BunTG6Yf9x1nynxoA',
authDomain: 'careerograph-e9963.firebaseapp.com',
databaseURL: 'https://careerograph-e9963.firebaseio.com',
projectId: 'careerograph-e9963',
storageBucket: 'careerograph-e9963.appspot.com',
messagingSenderId: '669874223858'
},
firebaseExcelConfig: {
apiKey: 'AIzaSyBHsAxVgiuM0_xLd3BunTG6Yf9x1nynxoA',
authDomain: 'careerograph-e9963.firebaseapp.com',
databaseURL: 'https://careerograph-e9963.firebaseio.com',
projectId: 'careerograph-e9963',
messagingSenderId: '669874223858',
storageBucket: 'careerograph-excel',
},
在我注入构造函数私有存储的组件中:AngularFireStorage 然后调用
this.task = this.storage.upload(this.path, file, { customMetadata });
我如何选择一个桶来上传文件到它