Book Image

Getting Started with Angular - Second edition - Second Edition

By : Minko Gechev
Book Image

Getting Started with Angular - Second edition - Second Edition

By: Minko Gechev

Overview of this book

Want to build quick and robust web applications with Angular? This book is the quickest way to get to grips with Angular and take advantage of all its new features.
Table of Contents (16 chapters)
Getting Started with Angular Second Edition
Credits
Foreword
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

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...