Reputation: 604
I have different url for sites like
How can I get root domain
mypros.fit.edu.co
mypros.library.org
using typescript in angular 6+
I'm using window.location.host but this does not help, because it returns the url where I need the root url.
Upvotes: 0
Views: 217
Reputation: 248
If your url always starts the same, try using a simple replace:
url.replace('http://www.example.com.','');
Upvotes: 0