angular / angularfire

Angular + Firebase = ❤️
https://firebaseopensource.com/projects/angular/angularfire2
MIT License
7.67k stars 2.19k forks source link

feat(storage): add list method #2288

Closed AmitMY closed 3 years ago

AmitMY commented 4 years ago

Version info

Angular: ~9.0.0-rc.7

Firebase: ^7.6.1-0

AngularFire: ^5.3.0-rc.4

Feature

I'm trying to show a files list of a specific user, which I store in firebase storage. Firebase offers a list method: https://firebase.google.com/docs/reference/js/firebase.storage.Reference#list

But angularfire doesn't have such method.

I am aware I can access this.storage.storage.ref('my-folder'), just wanted to ask for a better service-solution

KrustyHack commented 4 years ago

Ay,

On my side I'm able to list all files :

this.storage.ref(this.userService.storagePath + '/album/').listAll().subscribe(data => {
    data.items.forEach(element => {
    console.log(element);
    });
});

Where this.storage is an instance of AngularFireStorage :

constructor(private storage: AngularFireStorage, private userService: UserService) {
}

It's not what you're trying to do ?