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

Leaving sticky state throws error: "TypeError: state.params.$$keys is not a function" #323

Open AlexanderFlatscher opened 8 years ago

AlexanderFlatscher commented 8 years ago

Hey Chris,

first of all thank you for this great plugin! I'm using the sticky states, to keep the background state of a modal view (similar to your example). But I run into an error, if I want to change the state on an open modal: TypeError: state.params.$$keys is not a function at resolveState ...

I prepared a plunker to replicate the issue: http://plnkr.co/edit/1tLs2tgU1G2SUZgnB4Wr?p=preview

To replicate the error in the plunker click on:

If there is any more information I can help with, let me know!

christopherthielen commented 8 years ago

Notes...

First thing I noticed is that sticky states prepped the transition incorrectly.

-----------------------------------------------------
angular.js:13550    Current transition:  brand.otherview: {"brand":"1"}:  -> brand.sticky: {"brand":2}
angular.js:13550 Before transition, inactives are:   :  ["brand.sticky"]
angular.js:13550 After transition,  inactives will be:  []
angular.js:13550 Transition will exit:   ["EXIT: brand", "EXIT: brand.otherview"]
angular.js:13550 Transition will enter:  ["ENTER: brand", "REACTIVATE: brand.sticky"]
angular.js:13550 SurrogateFromPath:  ["reactivate_phase1:brand.sticky", "brand", "brand.otherview"]
angular.js:13550 SurrogateToPath:    ["brand", "reactivate_phase1:brand.sticky", "reactivate_phase2:brand.sticky"]

It is trying to reactivate brand.sticky which is clearly a violation of this snippet from the docs:

screen shot 2016-06-03 at 3 33 06 pm
antch commented 6 years ago

Is there a work-around for this issue? I'm currently on ui-router v0.2.13 and extras v0.0.11 and am willing to attempt an upgrade if this is fixed in a later version, but seeing as this is still open I'm guessing not...