D
I don't know if I understand your problem well, but it seems you're making a for, which is a synchronous method and within it firing various asynchronous methods, which means that the for will end and follow before the uploads end, if what you want is to bring that upload code to a "sync" pro mode for stay waiting, you can convert observable into promisse and use async await, you will "lost" the status of progress in this case, but I believe that the for will wait for the upload in this case.look at an example of "synchronous" upload on firebase storageasync upload(file) {
const fileName = `${new Date().getTime()}-${file.name}`;
const filePath = `${this.PATH}/${fileName}`;
const fileRef = this.afStorage.ref(filePath);
await this.afStorage.upload(filePath, file).snapshotChanges().toPromise();
const urlFile = await fileRef.getDownloadURL().toPromise();
return { urlFile: urlFile, fileName: file.name };
}
inside for It would be like this:for (let i = 0; i < item.fileToUpload.length; i++){
await upload(item.fileToUpload[i])
}