You can use the activated route component’s snapshot to get this url.
import { Router, ActivatedRoute } from '@angular/router';
constructor(
private router: Router,
private activatedRoute: ActivatedRoute) {
console.log("routes");
console.log(activatedRoute.snapshot.url); // array of states
console.log(activatedRoute.snapshot.url[0].path);
}






![Cannot read property ‘toLowerCase’ of undefined [ERROR] An error occurred while running subprocess cordova.](https://blog.rahulbhutani.com/wp-content/uploads/2020/12/ionic-enable-xcode-permissions-banner-100x70.png)











