as the title: novice to angular, I really don"t understand the official method of obtaining routing parameters. The code is as follows
// /-sharp/store/assets-list/case
/*
:
store
assets-list
caseid
:assets-listngOnInit
*/
questions are as follows
// assets-list
import { Router, ActivatedRoute, ParamMap } from "@angular/router";
constructor(
private router: Router,
private routerParams: ActivatedRoute
) { }
ngOnInit() {
this.routerParams.snapshot.paramMap.get("id") // id
}
/*
* caseid,
*
* vue watch router
*/
some people seem to use Observable objects after reading the official documents, but copy the official demo code and get no results at all (no errors reported)
online, etc.