Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular routing keeps redirecting me to the home page #26

Open
monikap90 opened this issue Oct 25, 2023 · 0 comments
Open

Angular routing keeps redirecting me to the home page #26

monikap90 opened this issue Oct 25, 2023 · 0 comments

Comments

@monikap90
Copy link

I am facing a issues with the routing in Angular .It keeps redirecting me to the home page even though I am entering a valid url (http://localhost:4200/services)
This is my code:

app.routing.module

const routes: Routes = [
{path: 'services', loadChildren: () => import('./routes/services/services.module').then(m => m.ServicesModule)},
{ path: '', loadChildren: () => import('./routes/home/home.module').then(m => m.HomeModule) },
{ path: '', redirectTo: 'home', pathMatch: 'full' },
{ path: '**', pathMatch: 'full', redirectTo: ''},
];

home-routing.module

const routes: Routes = [{ path: '', component: HomeComponent, children: [
{ path: '', component: HomeStartingViewComponent },
{ path: '', component: MeetUsComponent },
{ path: '', component: ServiceItemsComponent },
{ path: '', component: TitleComponent },
{path:'', component:CaseStudyComponent},
{path: '', component:BenefitsComponent},
{path:'', component:PartnersComponent}],
}]

services-rouiting.module

const routes: Routes = [{ path: '', component: ServicesComponent, children: [
{path:'', component:TitleComponent}
] }];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant