angular-ui / ui-router

The de-facto solution to flexible routing with nested views in AngularJS
http://ui-router.github.io/
MIT License
13.56k stars 3.01k forks source link

onExit hook on a Transition never fires #3713

Closed scooper91 closed 4 years ago

scooper91 commented 6 years ago

This is a (check one box):

My version of UI-Router is: 1.0.18

Bug Report

Current Behaviour:

onExit hook registered on a Transition never fires.

Expected Behaviour:

Transition onExit hook fires when Transition or TransitionService exits.

I know I can register a global onExit hook on the TransitionService, but my use-case is to only register it for the current Transition.

It's slightly ambiguous in the docs whether the hook is registered globally (for any state change) or specifically for that transition. Either way, I'd expect it to be called at some point.

Link to Plunker or stackblitz that reproduces the issue:

https://embed.plnkr.co/gyW08ObHH39CA0fbqiE3/ https://stackoverflow.com/questions/50971585/ui-router-transition-exit-hook-never-fires

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

This does not mean that the issue is invalid. Valid issues may be reopened.

Thank you for your contributions.