In my ember app I want to display some data within the index route, that needs to be fetched from the server. This works pretty well, if the user accesses the page via the root url ‘my-app.com/’.
However, if the page is accessed via a previous state for instance a nested url ‘my-app.com/resource1/resource2’ then the ‘setupController’ hook of the index route does not get called and the model never is loaded.
I was working around that by loading that data within the first sub route e.g. ‘my-app.com/resource1’, if it hasn’t been already loaded. This however seems to be a pretty ugly workaround. Is there any way I could make ember to always load the index route?