How to get current route?

Forums AngularHow to get current route?
Staff asked 1 month ago

I want to find current route how it is possible?

Answers (1)

Add Answer
Staff answered 1 month ago

To get Current route import Router from @angular/router as following :

import { Router } from ‘@angular/router’;
Then Inject in component as
constructor(private router : Router)
{
}
After this you can call Url  Parameter by using below statement.
console.log(this.router.url)
Thanks.

Subscribe

Select Categories