angular 取路由参数进行判断
import { Location } from ‘@angular/common’ import {Router} from ‘@angular/Router’ constructor(private location:Location,private router:Router){ router.events.pipe(filter((event)=>event instanceof NavigationEnd)).subscrible(event=>{ event.url当前路由信息(不包含自动跳转的) event.urlAfterRedirects 当前路由详细信息(暂时自动跳转) }) }