PillowPillow / ng2-webstorage

Localstorage and sessionstorage manager - Angular service
MIT License
428 stars 92 forks source link

Custom configuration is ignored when decorators are used #55

Closed esanzgar closed 6 years ago

esanzgar commented 7 years ago

Version: ngx-webstorage@1.8.0

I have configured ngx-webstorage to use a custom prefix and separator. Ng2Webstorage.forRoot({ prefix: 'my_custom', separator: '.', caseSensitive: true }),

  1. When I use the decorator like this: @LocalStorage('test') private i:string; Actual result: ng2-webstorage|test = null Expected result: my_custom.test = null

  2. When I use the decorator like this: @LocalStorage('test', 'hello') private i:string; Actual result: ng2-webstorage|test = 'hello' Expected result: my_custom.test = 'hello'

  3. When I use the decorator like this: @LocalStorage('test') private i:string = 'hello; Actual result: ng2-webstorage|test = null my_custom.test = 'hello' Expected result: my_custom.test = 'hello'

owen26 commented 7 years ago

I'm having the same issue. It looks like something is wrong during the initialisation of this package. Default configurations been applied before custom configurations take effect.

rhefner commented 7 years ago

+1 Also seeing this issue.

svitlychnyi commented 6 years ago

Can someone check my pull request for this issue?

PillowPillow commented 6 years ago

fixed in dev, should be available with the next version tonight

svitlychnyi commented 6 years ago

@PillowPillow works like a charm :)