The solution given by Ankur Garg works, since location.path() returns the path in the address bar and not the currently visible component route.
This is especially helpful in situations where the user has typed the url in the address bar and pressed enter.
For example if you type in https://somedomain.com/sent, this request will go to the server first and will not be handled by the angular route handling. In case of a catch all scenario common on Single Page Applications (SPA), where irrespective of the requested URL, always index.html is sent back by the server, the first thing that loads, would be app.component, and inside that, if you use router.url you will always get "/" and not "/sent".
So if you need to store the path that was originally requested by the user, you can use location.path() and keep it somewhere. Once everything is done on the client side, such as Authentication, Access verification etc, you can always redirect the user to the originally requested path.
This not only works with typed urls in the address bar but urls shared over emails, social media etc.