When accessing my homepage, I want to see a header, footer, and the home-news-page displayed. Additionally, when I click on a link in the header, I would like the content of the home-news-page to change accordingly. Here is how my routing is currently set up:
const ROUTES: Routes = [
{
path: '', component: HomeComponent, children: [
{ path: '/sign-up', component: SignUpComponent },
{ path: '/sign-in', component: SignInComponent },
]
},
{ path: '404', component: Page404Component },
{ path: '**', redirectTo: '404'},
];
In the HTML code of my app.component, I only have a routing-outlet
.
The structure of my home-page is as follows:
<app-header></app-header>
<router-outlet></router-outlet>
<app-footer></app-footer>
Currently, the header and footer are displayed correctly, and when clicking on a link, the desired content is shown. However, by default, I want the component HomeNewsComponent
to be displayed, but I'm not sure how to achieve this.
I understand that this should be configured in the routing module. I have tried using
path: '', component: HomeNewsComponent
, but in this case, only the news content is shown without the header and footer.
I would greatly appreciate any guidance on how to solve this issue.