📜  路由器导航传递参数 - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:30.131000             🧑  作者: Mango

代码示例1
this.router.navigate(['action-selection'], { state: { example: 'bar' } });
...
constructor(private router: Router) {
  console.log(this.router.getCurrentNavigation().extras.state.example); 
  // should log out 'bar'
}