小编kic*_*chu的帖子

角度ActivatedRoute中的this.route.params和this.route.snapshot.params有什么区别

constructor(private recipeService : RecipeService , private route : ActivatedRoute) { }

  ngOnInit() {
    const id = this.route.params['id'];
const id = this.route.snapshot.params['id'];
  }
Run Code Online (Sandbox Code Playgroud)

角度中的route.snapshot.params和route.params有什么区别我们什么时候应该使用route.snapshot.params,什么时候应该使用route.params

angular

4
推荐指数
1
解决办法
1万
查看次数

标签 统计

angular ×1