Issue when using storageFor with native classes
danr1979 opened this issue · 3 comments
danr1979 commented
Hi.
We are trying to use the storageFor function in our Ember service, which uses native JS classes rather than EmberObject. I am doing the following to initialise:
export default class InitialisationService extends Service {
localStorage = storageFor('user-settings');
...
}
and then setting values like so:
this.localStorage.brandingPrimaryColour = 'red';
but the values are not appearing in local storage.
Should ember-local-storage work with native classes or am I doing something wrong?
Thanks.
jking6884 commented
@danr1979 Were you able to resolve your issue (I'm guessing so since you closed this issue). I was curious what the problem was for you.
danr1979 commented
No, so I ended up writing my own native class ember service to interact with the browser's localstorage directly. It's not as fully featured as this addon but works with native classes.