Skip to content

Documentation Request: multi-bucket via StorageBucket injection token #1875

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
stot3 opened this issue Sep 13, 2018 · 4 comments
Closed

Documentation Request: multi-bucket via StorageBucket injection token #1875

stot3 opened this issue Sep 13, 2018 · 4 comments

Comments

@stot3
Copy link

stot3 commented Sep 13, 2018

Hey, Google functions are applicable to a whole bucket, thus, AngularFireStorage needs to be able to access multiple buckets within a project. I figure, the syntax should look like,
storage.bucket({bucketId}).ref().put()
storage.bucket({bucketId}).ref()

ex.
storage.bucket("myCustomId").ref(filepath).delete()
storage.bucket("gs://path").ref(filepath).put() etc.

I have tried switching the environments with the storage bucket as a property in another firebase config, but I have had no success with trying to make it work. I also understand that there is a way to use the Firebase SDK to do so but I'm afraid that importing the entire SDK would increase my bundle size too much. Is there a way to incorporate this into future releases? Is there a way for me to help?

@jamesdaniels
Copy link
Member

There's an injection token, StorageBucket that you can provide. I will leave this issue open for documentation.

@jamesdaniels jamesdaniels changed the title Feature Request: Multi-bucket Support! Documentation Request: multi-bucket via StorageBucket injection token Sep 21, 2018
@galki
Copy link

galki commented Dec 5, 2018

The docs leave me confused - why does it still say AppModule when I can just change the firebase config directly? Also my attempt at using StorageBucket to specify a non-default bucket in a lazy-loaded module did not work. ← solved by importing AngularFireStorageModule in same module

@aravindas4
Copy link

aravindas4 commented Mar 1, 2019

In app.module.ts we have code snippet like this:

providers: [
        { provide: StorageBucket, useValue: 'xyz-1' }
]

We need to implement dynamic useValue. We'll get the value after login happens. (Ex: 'xyz-2').
Is there a way to do?

@jamesdaniels
Copy link
Member

Not work the current API. Will consider this in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants