christopherthielen / ui-router-extras

THIS PROJECT IS NO LONGER MAINTAINED -- Extras for UI-Router for AngularJS. Sticky States (a.k.a. parallel states), Deep State Redirect (for tab-like navigation), Future States (async state definition)
http://christopherthielen.github.io/ui-router-extras/
MIT License
917 stars 211 forks source link

What does is mean $stickyState. stateExiting() parameters? #298

Closed yy-dev7 closed 8 years ago

yy-dev7 commented 8 years ago

I don't understand the 3 parameters: exiting, exitQueue, onExit. Who can give me an Example? Thanks!

christopherthielen commented 8 years ago

exiting is the state currently being exited exitQueue is the list of all the states that will be exited onExit is the state's real onExit callback, if it exists

This is deep into the guts of how sticky states works. The to and from paths are replaced with surrogate paths (use $stickyStateProvider.enableDebug(true) to see the real paths and surrogate paths). These surrogates are set up with onEnter/onExit callbacks such that the normal ui-router code will call them in the right order.