If I use $state.go with destination state set to the same state as the one I'm already on, and I use reload:true, beforeleave is never fired


#1

If I use $state.go with destination state set to the same state as the one I’m already on, and I use reload:true, beforeleave is never fired.

Is that intended behavior?


#2

because the reload flag only executes the controller again and there is not really a state-change, transition or a view-change.


#3

so in order to trigger all events that are related to statechange/transition, etc. I’d just manually trigger these events with $scope.$emit?


#4

i would put the logic of those events in an own function.

–> $state.go returns a promise if it has finished --> so you can do something like this.

$state.go(XXXX).then(youFunction);

Triggering all events is a little bit too much i think.


#5

alright, thanks! I’ll check out what works out best for me.