Reader small image

You're reading from  Getting Started with Angular - Second edition - Second Edition

Product typeBook
Published inFeb 2017
Reading LevelIntermediate
PublisherPackt
ISBN-139781787125278
Edition2nd Edition
Languages
Tools
Right arrow
Author (1)
Minko Gechev
Minko Gechev
author image
Minko Gechev

Minko Gechev is a software engineer who strongly believes in open source software. He has developed numerous such projects including codelyzer, the AngularJS style guide, aspect.js and many others, and is one of the coauthors of the official Angular style guide.
Read more about Minko Gechev

Right arrow

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...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Getting Started with Angular - Second edition - Second Edition
Published in: Feb 2017Publisher: PacktISBN-13: 9781787125278

Author (1)

author image
Minko Gechev

Minko Gechev is a software engineer who strongly believes in open source software. He has developed numerous such projects including codelyzer, the AngularJS style guide, aspect.js and many others, and is one of the coauthors of the official Angular style guide.
Read more about Minko Gechev