import { Component } from '@angular/core' ; import { ActivatedRoute } from '@angular/router' ; @ Component ( { selector : 'product' , template : `<h1 class="product">Product Detail for Product {{productID}}</h1>` , styles : [ '.product {background: cyan}' ] } ) export class ProductDetailComponent { productID : string ; page : string ; constructor ( route ) { this . productID = route . snapshot . paramMap . get ( 'id' ) ; } }