Ember nested routes and it's active class
Ember adds automagically a css class active
to all link-to
elements under the current route.
So let's say you have this in your router:
If you access a page like http://localhost:4200/blog/last-post
, all the following links will have the active
css class.
So far so good, but now, if by any reason you just want either child link or parent link with the active
class you can change the parent link-to
to use .index
.
So both blog
and blog.index
links to the same url, but they act differently with active
class.