我想在 angular typescript 中找到先前路线中的参数。
我使用此代码:
private previousUrl: string = undefined;
private currentUrl: string = undefined;
constructor(private router: Router) {
this.currentUrl = this.router.url;
router.events.subscribe(event => {
if (event instanceof NavigationEnd) {
this.previousUrl = event.url;
this.currentUrl = this.currentUrl;
}
});
}
但我无法访问此网址的参数:
http://localhost:4200/claims-manager/200/edit
我想要 ti 访问200。我怎样才能在 url 中找到参数????
慕少森
红颜莎娜
料青山看我应如是
相关分类