我无法在route.params中返回空值。而是返回一个包含string: "null"
this.route.params.subscribe(params=> {
console.log(typeof params['parameter']);
} //it says it is a string
let routeParam = null;
this.router.navigate(['/heroes', {parameter: routeParam}]);
答案 0 :(得分:0)