Search code examples
angularfirebaseangularfire2angularfire5

Download a list from storage with angularfire2


I can successfully save a document in firebase.

I would now like to display all the documents contained in a particular storage folder

But the documentation only specifies how to get a specific document:

@Component({
  selector: 'app-root',
  template: `<img [src]="profileUrl | async" />`
})
export class AppComponent {
  profileUrl: Observable<string | null>;
  constructor(private storage: AngularFireStorage) {
     const ref = this.storage.ref('users/davideast.jpg');
     this.profileUrl = ref.getDownloadURL();
  }
}

Solution

  • Finally i save the link doc in my database to retry the information.

    SaveDoc() {
    const Patientid = this.patientid;
        const name = Date.now().toString();
        const newDoc = new Doc(name, Patientid, this.url);
        console.log(this.url);
        this.docsService.CreatePpsDoc(newDoc);
    }