Which of the following line should be used to display passed route parameter?
router configuration:
RouterModule.forRoot([{
path: "child/:id",
component: ChildComponent
}])
child.component.ts:
import { Component } from '@angular/core';
import { ActivatedRoute} from "@angular/router";
@Component({
selector: 'child',
templateUrl: './child.html'
})
export class ChildComponent {
constructor(private activatedRoute: ActivatedRoute) {
console.log(...);
}
}