1

can you ask me any idea, how to navigate automatic, or reload in FirstPageComponent ? Or any idea. I want only to open FirstPageComponent

I have this routes.ts

const routes: Routes = [
  {
    path: 'home',
    component: HomeComponent,
    canActivate: [AuthGuard],
    children: [
      {
        path: 'fp', component: FirstPageComponent
      },
      {
        path: 'image', component: ImageComponent
      },
      {
        path: 'settings', component: SettingsComponent
      }
    ]
  },
  { path: 'login', component: LoginFirstComponent },
  { path: '**', redirectTo: 'home', pathMatch: 'full' },
];

In HomeComponent I have this code:

<page-router-outlet></page-router-outlet>

Thank you!

2 Answers 2

2

Try

{ path: '', redirectTo: '/home/fp', pathMatch: 'full' },

Which will trigger your auth guard I believe, so make sure the correct auth is provided.

Sign up to request clarification or add additional context in comments.

Comments

0

You just need to add an empty path object to the Routes like this:

{ path: '', redirectTo: '/home', pathMatch: 'full' },

2 Comments

Yes, but I want to open FirstPageComponent, not HomeComponent
In this case you need to update the route to '/home/fp' and you should be good to go.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.