My component shows up but i get an error message when the page is loaded. I can\'t seem to solve the error message at all after looking at a bunch of resources.
Erro
if you have child component and you want to navigate use this way
router servive
const routes: Routes = [
{
path: '',
component: LoginComponent
},
{
path: 'home',
component: HomeComponent,
children: [
{
path: 'enter',
component: EnterDetailsComponent,
},
{
path: 'find',
component: FindDetailsComponent,
}
]
}
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }
use navigate([]) method this way
component constructor
this is how this._router comes
constructor( private _router: Router) {}
this._router.navigate(['/home/find']);