Defining parameterized views
As the next step, let's dedicate a special page for each developer. On it, we'll be able to take a detailed look at their profile. Once the user clicks on the name of any of the developers on the home page of the application, they should be redirected to a page with a detailed profile of the selected developer. The end result will look as follows:
Figure 2
In order to do this, we will need to pass an identifier of the developer to the component that shows the developer's detailed profile. Open app.ts
, and add the following import:
import {DeveloperDetails} from './developer_details';
We haven't developed the DeveloperDetails
component yet, so, if you run the application, you will get an error. We will define the component in the next paragraph, but before this, let's alter the routes' definition of the app.ts
:
const routingModule = RouterModule.forRoot([ ... { component: DeveloperDetails, path: 'dev-details/:id', children...