I have an AccessGuard class in my project which its work is to determine if user can access to the route or not. I used the router.url to get the current route
router.url
Current URL can be returned from RouterStateSnapshot as shown below,
import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, Router } from '@angular/router'; canActivate(next: ActivatedRouteSnapshot, state: RouterStateSnapshot){ console.log(state.url); ... }