# Conditional loading

**URL:** <https://discuss.emberjs.com/t/conditional-loading/9604>\
**Category:** Uncategorized\
**Created:** [January 29, 2016, 3:57pm UTC](https://discuss.emberjs.com/t/conditional-loading/9604 "2016-01-29T15:57:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mission](https://avatars.discourse-cdn.com/v4/letter/m/0ea827/32.png) [@mission](https://discuss.emberjs.com/u/mission)\
**Post date:** [January 29, 2016, 3:57pm UTC](https://discuss.emberjs.com/t/conditional-loading/9604/1 "2016-01-29T15:57:02Z")

</div>

Hi,

I’d like to load different models according to the set user preferences… The user has them defined as “modules” via hasMany… I just don’t know how to conditionally load this modules (multiple different model loads). So multiple models which are conditionally defined in a route and the conditionally show in the template.

I’d like to use this in a “dashboard” page… where i would show an overview from different modules… so basically making the same query as I’m using for the model index (just with limit record set).

I’m using ember 2.2 with ember-data 2.3 and ember-simple-auth 1.0.0

Thank you!

---

<div class="post-metadata">

**Author:** ![vikram7](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/vikram7/32/12393_2.png) [@vikram7](https://discuss.emberjs.com/u/vikram7)\
**Post date:** [January 29, 2016, 5:12pm UTC](https://discuss.emberjs.com/t/conditional-loading/9604/2 "2016-01-29T17:12:21Z")

</div>

Do you mind including relevant code you have currently?

---

<div class="post-metadata">

**Author:** ![mission](https://avatars.discourse-cdn.com/v4/letter/m/0ea827/32.png) [@mission](https://discuss.emberjs.com/u/mission)\
**Post date:** [January 29, 2016, 5:34pm UTC](https://discuss.emberjs.com/t/conditional-loading/9604/3 "2016-01-29T17:34:04Z")

</div>

Well, I really don’t have any code to share… I was just prototyping with this:

```
export default Ember.Route.extend({

  model() {
    return Ember.RSVP.hash({
      posts: this.store.findAll('post'),
      tags: this.store.findAll('tag'),
      category: this.store.findAll('category'),
      weather: this.get('weather').current()
    });
  },

  setupController(controller, models) {
    controller.set('posts', models.posts);
    controller.set('tags', models.tags);
    controller.set('categories', models.categories);
    controller.set('weather', models.weather);
  }

});

```

from: [http://emberigniter.com/load-multiple-models-single-route/](http://emberigniter.com/load-multiple-models-single-route/)

But I really can’t do this dynamically for different modules (from different users).

BR
