#Routes help

2 messages · Page 1 of 1 (latest)

fathom crater
#
const routes: Routes = [
  //you can use data in the routes!
  {
    //I need this to load me the home page component that has information about the website
    path: '', component: HomeComponent, data: { title: "Home", requireUser: false }, children: [
      //this sends me to domain.com/sign-in to sign in
      { path: 'sign-in', component: SignInComponent },
      //this sends me to the profile of a specific user
      //ex domain.com/username
      { path: ':userName', component: PortfolioComponent },

    ]
  },

I am trying to do what's written in the comments, but the home page is loading everywhere.
p.s I have router-outlet in my HomePage, and I need that to make the children work
Thanks a lot 🫡

atomic spindle
#

I need that to make the children work

If having the Home Page everywhere is a problem, the other pages should not be children, but dedicated routes declared at the same level as Home Page.