Skip to content

Commit f42b2a5

Browse files
committed
created the routes in the app.routes
1 parent 79b55a4 commit f42b2a5

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed

src/app/app.config.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,15 @@ import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';
22
import { provideRouter } from '@angular/router';
33

44
import { routes } from './app.routes';
5-
import { provideClientHydration, withEventReplay } from '@angular/platform-browser';
5+
import {
6+
provideClientHydration,
7+
withEventReplay,
8+
} from '@angular/platform-browser';
69

710
export const appConfig: ApplicationConfig = {
8-
providers: [provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(routes), provideClientHydration(withEventReplay())]
11+
providers: [
12+
provideZoneChangeDetection({ eventCoalescing: true }),
13+
provideRouter(routes),
14+
provideClientHydration(withEventReplay()),
15+
],
916
};

src/app/app.routes.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
11
import { Routes } from '@angular/router';
2+
import { MasterpageComponent } from './layout/masterpage/masterpage.component';
3+
import { HomeComponent } from './features/home/pages/home/home.component';
4+
import { AboutUsComponent } from './features/about-us/pages/about-us/about-us.component';
5+
import { OurServicesComponent } from './features/our-services/pages/our-services/our-services.component';
6+
import { ContactUsComponent } from './features/contact-us/pages/contact-us/contact-us.component';
27

3-
export const routes: Routes = [];
8+
export const routes: Routes = [
9+
{
10+
path: '',
11+
component: MasterpageComponent, // Master page
12+
children: [
13+
{ path: '', component: HomeComponent, title: 'Home' },
14+
{ path: 'about', component: AboutUsComponent, title: 'About Us' },
15+
{ path: 'services', component: OurServicesComponent, title: 'Our Services' },
16+
{ path: 'contactus', component: ContactUsComponent, title: 'Contact Us' },
17+
// Add other routes here
18+
]
19+
},
20+
{ path: '**', redirectTo: '' } // Catch-all route
21+
];

0 commit comments

Comments
 (0)