Now that you've set up the app to use Angular Router, you need to define the routes.
In this activity, you'll learn how to add and configure routes with your app.
- 
      
      
  Define a route inapp.routes.tsIn your app, there are two pages to display: (1) Home Page and (2) User Page. To define a route, add a route object to the routesarray inapp.routes.tsthat contains:- The pathof the route (which automatically starts at the root path (i.e.,/))
- The componentthat you want the route to display
 import {Routes} from '@angular/router';import {HomeComponent} from './home/home.component';export const routes: Routes = [ { path: '', component: HomeComponent, },];The code above is an example of how HomeComponentcan be added as a route. Now go ahead and implement this along with theUserComponentin the playground.Use 'user'for the path ofUserComponent.
- The 
- 
      
      
  Add title to route definitionIn addition to defining the routes correctly, Angular Router also enables you to set the page title whenever users are navigating by adding the titleproperty to each route.In app.routes.ts, add thetitleproperty to the default route (path: '') and theuserroute. Here's an example:import {Routes} from '@angular/router';import {HomeComponent} from './home/home.component';export const routes: Routes = [ { path: '', title: 'App Home Page', component: HomeComponent, },];
In the activity, you've learned how to define and configure routes in your Angular app. Nice work. 🙌
The journey to fully enabling routing in your app is almost complete, keep going.