O'Reilly logo

Switching to Angular - Third Edition by Minko Gechev

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Defining nested routes

Now, let's jump to the DeveloperDetails definition. In your working directory, create a file called developer_details.ts and enter the following content:

import {Component} from '@angular/core'; import {ActivatedRoute} from '@angular/router'; import {Developer} from './developer'; import {DeveloperCollection} from './developer_collection'; import {DeveloperBasicInfo} from './developer_basic_info'; import {DeveloperAdvancedInfo} from './developer_advanced_info'; import 'rxjs/add/operator/take'; @Component({ selector: 'dev-details', template: `...`, }) export class DeveloperDetails { public dev: Developer; constructor(private route: ActivatedRoute, private developers: DeveloperCollection) {} ngOnInit() { this.route.params.take(1) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required