How do you get the current route?

Posted by Andre Scott | Updated on

In Angular, there is an url property of router package to get the current route. You need to follow the below few steps,

1. Import Router from @angular/router

2. Inject router inside constructor

3. Access url parameter


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers