I'm using a single controller in two states. If I navigate within these two states, and try to handle $stateChangeSuccess event, I'm facing an issue which is, in each state, the event is triggering twice.
$scope.$on('$stateChangeSuccess', function (ev, to, toParams, from, fromParams) {
// some code...
});
I know that this is a game of $scope, but how can I handle it. Thanks in advance...