Ok. I have a simple question regarding how ember handles re-rendering of routes...
The Application
Stuff
-------------------------------
Ember : 1.8.1
Ember Data : 1.0.0-beta.12
Handlebars : 1.3.0
jQuery : 1.11.2
-------------------------------
Teh Codes
router.js
this.resource('categories', {path: '/categories'}, function(){
this.resource('category', {path:'/:cid'});
});
I have two very simple nested templates. One named categories and one named category. They work just as you would expect. However my ember app has no views defined in the application, just templates.
The Question
How can I change a simple property of the parent route's controller, say foo: 0 from 0 to 1 when going from the parent to the child route via link-to helpers only (i.e. not reloading the route via the address bar)?
The solution needs to work when going from parent to child and vice versa, all from link-to helpers, just to be clear. I have gotten this behavior to work when going from parent to child route, just not vice-versa.
All I want to do is toggle this property of the parent route from 0 to 1
UPDATE
I want to basically toggle the foo variable from 1 to 0 by navigating back and forth between the two routes. Imagine clicking on the link-to between these two routes 10 times and just seeing the property of the parent route get updated each time to the new value. Why is this not a simple hook in the controller? What am i missing?
Vain Attempts Section
I have done a load of googling and tried lots of various hooks in the routes (beforeModel,model,setupController) and controllers. I have had no success. Would welcome a dead-easy method for tackling this if there is one. My apologies if I am missing something here.