mercredi 1 avril 2015

Neither model or setuController called on page refresh, but the correct route amd template chosen

I have an ember route like this;



this.resource('searchauctions', { path: 'section/search/:date_one/:date_two/:some_id});


When using link-to I can move into this route with no problems. When I refresh the page and check ember inspector I am in the correct route, the correct controller and the model has and object with the values I would expect, but the model or setupController hooks are not called so I can't capture the values to re run the search in order to populate the template.


My controller has an action on it which updates an array on the model, the gets the search values and uses;



var urlString = '/section/search/' + model.date_one + '/' + model.date_two + '/' + model.some_id;
window.history.pushState({}, null, urlString.trim());


To update the url. Is this what is causing the problem?


Basically refrshing the page is not calling the hooks I would expect, but it is choosing the correct template to use.





Aucun commentaire:

Enregistrer un commentaire