I've the following children routes:
{ path: '', component: LoginSingupComponent,
children: [
{ path: 'login', component: LoginComponent },
{ path: 'singup', component: SingupComponent },
]
},
Navigating to /login
or /singup
works ok (correct Component is loaded).
This is a excerpt from LoginSingupComponent
<nav md-tab-nav-bar class="mb-1">
<a md-tab-link routerLink="/login" routerLinkActive [routerLinkActiveOptions]="{exact: true}" #rla="routerLinkActive" [active]="rla.isActive">Entrar {{rla.isActive}}</a>
<a md-tab-link routerLink="/singup" routerLinkActive [routerLinkActiveOptions]="{exact: true}" #rla="routerLinkActive" [active]="rla.isActive">Criar uma conta{{rla.isActive}}</a>
</nav>
When on /login
all rla.isActive == false
when on /singup
all rla.isActive == true
Tried with and without exact: true
Try like this :
<nav md-tab-nav-bar class="mb-1">
<a md-tab-link [routerLink]="['/']" routerLinkActive="active" [routerLinkActiveOptions]="{exact: true}">Home</a>
<a md-tab-link [routerLink]="['/login']" routerLinkActive="active">Login</a>
<a md-tab-link [routerLink]="['/singup']" routerLinkActive="active">Signup</a>
</nav>