I'm loading data from a JSON API. My routes almost always need to fetch new data from the server. I don't have control over the API format.
I'm trying to use the functionality described in the Ember Asynchronous Routing guide. Specifically, I'm returning a promise in the route's model
hook so that I delay transitioning to the route until the data has loaded (and display a loading indicator in the meantime).
Everything (actions.loading
, afterModel
, etc.) seemed to be working as described in the guide. However, I get a showstopper error whenever I transition to a route I've been to before.
This JSBin is a minimal example that uses the same versions of the Ember and its dependencies that is included in the Starter Kit:
http://jsbin.com/zorey/1/edit?html,js,output
Click the first name, go back, and then click the second name. You'll see this error in your console:
Error while loading route: TypeError: Object #<Object> has no method 'apply'
What am I doing wrong?