Angular · Junior · Question 41 of 75
How are routes configured in an Angular app?
export const routes: Routes = [
{ path: "", component: Home },
{ path: "users/:id", component: UserPage },
{ path: "**", component: NotFound },
];- ✓Correct answer: With a
Routesarray passed toprovideRouter(routes) - 2By file names in a
pages/folder - 3With
<Route>elements inside the root template
Explanation
The router matches the URL against paths in order. :id is a route parameter, ** is a wildcard for unknown URLs and should go last.