I need something like this:
if ($state.get("^")) $state.go("^"); else $location.path('/');
But it apparently won't work (it always comes with $state.go , even if there is no parent state). How to correctly check if a specific state exists?
source share