structure is
1--login component
1.1--forget password component
1.2--reset password component
For that I created the module named "login module"
Here is my coding:
app.routing
{
path: '',
redirectTo: 'login',
pathMatch: 'full',
},
{
path: 'login',
component: LoginComponent,
children: [
{
path: 'login',
canActivate: [AuthServiceGuard],
loadChildren: './login/login.module#LoginModule'
}
]
}
login.routing
const routes: Routes = [
{
path:'',
component : LoginComponent,
data:{
title:'login'
},
children:[{
path:'forgotPassword',
component:forgotPwdComponent,
data:{
title:'ForgotPassword'
}
},
{
path:'resetPassword',
component:ResetPwdComponent,
data:{
title:'ResettPassword'
}
}]
And in login.html i used routerLink as,
<a class="achortag" routerLink="/forgotPassword">Forgot Password</a>
Now getting error like:
core.js:1673 ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'forgotPassword'
Error: Cannot match any routes. URL Segment: 'forgotPassword'
I called forgetpwdComponent and resetpwdcomponent in loginmodule and
I called loginmodule in appmodule Is there any problem in my step which I did.
can anybody guide me??