I'm assuming that you're trying to go to an abstract state and that won't work as abstract states will only be activated when you go to a child of that abstract state, i.e. you can't direct go to index1
or index2
, so this is not legal:
urp.otherwise("/index1");
it should be: urp.otherwise("/index1/id");
instead.
also why are you going to the states again within their own controller? $state.go('index2.id');
is pointless since by the time that line of code is reached
you are already in the state index2.id
. I think you meant to put those lines of code inside the controllers of the abstract states! Last bit not least don't forget that your abstract states MUST have a ui-view
themselves as they are hosting child states.