September 2017
Intermediate to advanced
450 pages
11h 24m
English
To add a child route to our router module, we will need to update its route configuration:
RouterModule.forRoot([ ... { path: "posts", component: PostsComponent, children: [{ path: ":id", component: PostComponent }] } ...])
import { Component, OnInit } from '@angular/core';import {ActivatedRoute} from "@angular/router";@Component({ selector: 'app-post', templateUrl: './post.component.html', styleUrls: ['./post.component.css']})export class PostComponent implements OnInit { Read now
Unlock full access