I am facing a situation where I have a specific URL structure like the one shown below.
http://localhost:8080/test#/users/list
Upon further investigation, I discovered the following information:
$location.url() returns -> "users/list"
$location.path() returns -> "users/list"
$location.absUrl() returns -> "http://localhost:8080/test#/users/list" which includes the full URL
$location.host() returns -> "localhost"
My objective now is to extract just the base part of the URL: http://localhost:8080/test#/
or simply test#/
. I am aware that I could achieve this by retrieving the entire URL and splitting it based on /
, but I am curious if there is an alternative method available.