I have two state in Angular UI router:
State
|-Menus (with 2 nested state)
|   |- menus.list
|   |- menus.instruction
|-Order
When I access menus.list from menus I get the scope with id 4 however when I access menus from Order I get scope with scope id 28.
The reason this create a problem for me because I register the following function inside Menus controller. 
$rootScope.$on('$stateChangeSuccess',function(event, toState, toParams, fromState, fromParams){
    if(toState.name === 'menus.list'){
        $scope.stateOrder = 1;
    }
    if(toState.name === 'menus.instruction'){
        $scope.stateOrder = 2;
    }
});
The problem I am facing is when I access menus.list from Menus it update my $scope.stateOrder in template file, but when I enter menus.list from Order state it doesn't update my $scope.stateOrder in template. Why this is happening?


$stateProvideroptions fromapp.js?