LoadingRoute only called once for dynamic segments

advertisements

How does one get ember to call the LoadingRoute each time one a dynamic route e.g. product/1 and product/2.

I've create a jsbin to illustrate the problem.


If you don't want to eager load all zoobats, the first time you go to any bat resource, you could change your router to

App.Router.map(function() {
  this.route('foo');
  this.resource('bat', {path: "/zoo/:bat_id"});
});

Now define App.BatRoute and change link-to's route from 'zoo.bar' to 'bar'. You will get loading for each dynamic route, without adding ZooLoadingRoute and you don't have to eager load all zoobats.

Check this jsbin