The routerLink directive has no effect in the md-toolbar component of Material 2.
toolbar.component.html:
<md-toolbar color="primary">
<a routerLink="/email-login" routerLinkActive="active"> Email </a>
</md-toolbar>
I have a route module with all the routes:
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
// Application Pages;
/* Public Pages */
import { EmailLoginPage } from './pages/public/email-login.page';
import { LinkedinLoginPage } from './pages/public/linkedin-login.page';
/* Private Parent Page */
import { Dashboard } from './pages/authenticated/dashboard';
/* Private Pages */
import { RecordsPage } from './pages/authenticated/records.page';
const routes: Routes = [
{ path: 'email-login', component: EmailLoginPage },
{ path: 'linkedin-login', component: LinkedinLoginPage },
{
path: 'dashboard',
component: Dashboard,
canActivate: [],
children: [
{ path: 'records', component: RecordsPage },
{ path: '', component: RecordsPage }
]
},
{
path: '',
redirectTo: '/email-login',
pathMatch: 'full'
}
];
@NgModule({
imports: [ RouterModule.forRoot(routes) ],
exports: [ RouterModule ]
})
export class RoutingModule {}
Does this have anything to do with the fact that the link is set as child element of a Material Directive? If so what is the best way to go about doing this?
Thanks.