PillowPillow/ng2-webstorage

Set or Change prefix after the app has already been initialized

thenewbeat opened this issue · 1 comments

Within my app I need to set a custom prefix. I'm doing this per the docs in AppModule. Unfortunately, I need to change this prefix based on data coming from a Service call made after the app has started.

I'd like to see a method for setting, or updating a prefix after the app has been initialized.

There is a static class called StorageKeyManager. internally all the configuration from forRoot, gets there. you could use setPrefix method of this class and change prefix dynamically, but it's not official API, so I can't be sure that it will not change