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

"alias-model-in-controller" should allow nested properties #79

Closed
buschtoens opened this issue Jun 6, 2017 · 0 comments
Closed

"alias-model-in-controller" should allow nested properties #79

buschtoens opened this issue Jun 6, 2017 · 0 comments

Comments

@buschtoens
Copy link
Contributor

export default Route.extend({
  store: service(),

  model() {
    const store = get(this, 'store');

    return hash({
      pets:   store.findAll('pet'),
      people: store.findAll('people')
    });
  }
});
export default Controller.extend({
  pets:   reads('model.pets'),
  people: reads('model.people')
});

Loading multiple different models via RSVP.hash and aliasing them is a common pattern in Ember applications. Currently alias-model-in-controller does not detect this and prompts the user to alias model.

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