By default, Angular 2 sets as active any url that at least has the url configured in the routerLinkActive. That is, the "/" URL exists in the "/application". So, Angular 2 puts active on both the first element and the second.
To solve this problem:
In the Docs of the routerLinkActive directive there is another directive where you pass the options of it, this directive is called [routerLinkActiveOptions], in which you can pass as value, an object with the parameter 'Exact' (boolean). Setting this parameter to true will cause the routerLinkActive to only add the class you passed in the "routerLinkActive" in the exact links. Therefore, if your URL is exactly "/", or exactly "/application", the active will be added respectively.
Example in practice
<li><a routerLink="/" routerLinkActive="ativo" [routerLinkActiveOptions]="{exact: true}">Página inicial</a></li>
<li><a routerLink="/aplicacao" routerLinkActive="ativo">Aplicações</a></li>
It is your choice to use the "[routerLinkActiveOptions]" directive in the "/application". You would do this if you want to create another sublink, for example: With the "/application/app1 URL".
Why Angular 2 does this as a standard?
For example, this feature is very useful when you want to create a "Nested menu" (multi-level dropdown menu), with this feature you can apply CSS to all actives in a practical way, in all levels of menus enabled.
Docs:
https://angular.io/docs/ts/latest/api/router/index/RouterLinkActive-directive.html
Try applying your routerLink with the attribute brackets: <a [routerLink]="/user/bob" routerLinkActive="Class1 class2">Bob</a>. All examples in the documentation are using: https://angular.io/docs/ts/latest/api/router/index/RouterLinkActive-directive.html
– lfarroco
It doesn’t work. I had already tested. :/
– buback
Did you set a <base href="/"> on your head? Looking at the Tour of Heroes I noticed that they changed some things from the RC5 to the launch, try to adjust your router according to their example: https://angular.io/docs/ts/latest/guide/router.html#! #base-href
– lfarroco
lfarroco, I defined yes. I’m poking around here in the meantime.
– buback