Angular 22 · Routing and forms
Define routes
Map URLs to components, with a redirect and a wildcard.
export const routes: Routes = [
{ path: '', component: HomeComponent },
{ path: 'users/:id', component: UserComponent },
{ path: '**', component: NotFoundComponent },
];
Official Angular 22 documentation