My current url is http://localhost:4200/test/dashboard.
I want to print base url i.e http://localhost:4200 using angular 5 features.
No need for angular specific features, window.location.origin will do it for you.
window.location.origin
1.4m articles
1.4m replys
5 comments
57.0k users