📅  最后修改于: 2022-03-11 14:48:21.299000             🧑  作者: Mango
// example url: details?id=2
constructor(private activatedRoute: ActivatedRoute) {
this.activatedRoute.queryParams.subscribe(params => {
console.log(params); // Prints {id: "2"}
});
}