"export 'Params' was not found in '@angular/router' -


in angular app, have imported params angular/router many times. in particular component getting error: "export 'params' not found in '@angular/router'

code:

import { params, activatedroute } '@angular/router'; //it works fine in parent component while gives warning in child component  

screenshot: enter image description here

my angular specs:

enter image description here

not sure why import params in code. assume you're using receive parameters during navigation. never explicitly import params, e.g.

constructor(route: activatedroute) {     this.productid = route.snapshot.params['id'];   } 

starting angular 4, use parammap instead:

constructor(route: activatedroute) {     this.productid = route.snapshot.parammap.get('id');   } 

if none of above solves problem, put breakpoint in code , see if route.snapshot.params contains expected value - problem may on sending part (the parent route).


Comments