I'm using ui-router for AngularJS; I'm handling the '$stateChangeSuccess' event, and trying to get the full path (after '#') for the current state. $location.hash() returns an empty string and $state.url returns only the portion of the path that applies to the nested state.
My full path #/a/b
$state.url == "/b"
$locadtion.hash() == ""
How can I get #/a/b or /a/b?
You can always use:
window.location
or:
window.location.hash
(if that's what you want).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With