When I trying go to myaddress/home I get the error. When a user enter in address line myaddress/home need to redirect him to myaddress/home/allQuestions. Another routes work. I use angular 8.
const routes: Routes = [ { path: '', component: MainLayoutComponent, children: [ {path: '', redirectTo: '/login', pathMatch: 'full'}, {path: 'login', component: LoginFormComponent}, {path: 'registration', component: RegistrationFormComponent} ] }, { path: 'home', component: HomeLayoutComponent, children: [ {path: '', redirectTo: '/allQuestions', pathMatch: 'full'}, {path: 'allQuestions', component: AllQuestionsComponent}, {path: 'addQuestion', component: AddQuestionComponent}, ], canActivate: [AuthenticationGuard] } ];
Error:
ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'allQuestions' Error: Cannot match any routes. URL Segment: 'allQuestions'