Skip to content
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

Using key as reference to a service #74

Open
bedrosenator opened this issue Feb 21, 2019 · 0 comments
Open

Using key as reference to a service #74

bedrosenator opened this issue Feb 21, 2019 · 0 comments

Comments

@bedrosenator
Copy link

I'm not sure if it was supported properly, but it worked well before upgrade to 0.3.8

We used a service to store query params in application controller to be accessible within our application.
So it was was working code

export const appQueryParams = new QueryParams({
  'someService.property': {
      as: 'property',
      defaultValue: 3600,
      replace: true,
      deserialize(value) {
        return parseInt(value);
      }
    }, 
});

export default Controller.extend(appQueryParams.Mixin, {
  someService: Ember.inject.service(),
})

But now it works only in case of alias is being set in controller like this

export const appQueryParams = new QueryParams({
  someServicePropertyAlias: {
      as: 'property',
      defaultValue: 3600,
      replace: true,
      deserialize(value) {
        return parseInt(value);
      }
    }, 
});

export default Controller.extend(appQueryParams.Mixin, {
  someService: Ember.inject.service(),
  someServicePropertyAlias: alias('someService.propertyAlias'),
})

Is this functionality supported? Or maybe there are issues in our code?
Thanks for help

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

1 participant