I was trying to fully understand the previous answer of the question emberjs – how to mark active menu item using router infrastructure
In the answer I tried to simplify (without using a outlet navigation and without adding a second level routing under the root) but in my case the active link doesn’t work ://
Here’s a fiddle :
http://jsfiddle.net/archange/Scqxw/
What I don’t understand in the fiddle is why the “isActive: function()” is not updated after the set on the router… :/
So if someone passing by can explain me the reason. Big Thanks.
And if someone has another solution for handling navigation menu (perhaps using bindAttr ?)
Thanks
What is happening here is that when a template/view creates another view, it gives the newly created view access to it’s controller. For example:
The controller of the navigation view is going to be the instance
applicationController. This is expected behavior.If you want to tell your newly created
NavigationViewto use another controller, just pass that in, like so:Please note that I wired these two controllers together in
App.ready.Here is your edited fiddle: http://jsfiddle.net/Scqxw/5/