hi everyone.
I want to build the following route:
App.Router.map(function () {
this.resource('entries', { path: '/entries' }, function () {
this.resource('entry', { path: '/entry/:id' }, function () {
this.route('edit');
});
});
});
I’ve nested the entry route, because I want to show the complete list and the details for the selected entry at the same time.
To control my views I set some properties in the routes afterModel and willTransition functions:
App.EntryRoute ->
afterModel: entry.isActive=true
willTransition: entry.isActive=false
App.EntryEditRoute ->
afterModel: entry.isEditing=true
willTransition: entry.isEditing=false
If I go from one route to another or skip the middle route the properties are not reset correctly. Because of that I think willTransition is not the right function to reset the properties. Can somebody tell me how to reset the properties the right way?
I’ve made a little fiddle to help understanding: fiddle
thanks in advance