import { 
Location }
from
'@angular/common';





console.
log(
location.pathname);



以上就是获取URL地址



获取参数:


import { 
ActivatedRoute }
from
'@angular/router';




constructor( @
Inject(
DOCUMENT)
private document
:
Document,
private route
:
ActivatedRoute,
private service
:
LoadOrdersService) { }



const
loadTaskId
:
string
|
null
=
this.
route.
snapshot.
paramMap.
get(
'loadTaskId');