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

fix(sticky): handle the null locals when exiting inactiveState #286

Closed PierreReliquet closed 8 years ago

PierreReliquet commented 8 years ago

Fixes #258

Under some weird circumstances on the application the locals of a state are null triggering an exception inside ui-router-extras. A workaround was to wrap some call to $state.go in a $timeout but this is not very elegant.

I have added a test that demonstrates that even with a null locals the code is smooth.

lalitkapoor commented 8 years ago

+1 This solves the problem for me. @christopherthielen worth a look. Thanks! Maybe the files in the release dir shouldn't be included in the pr?

christopherthielen commented 8 years ago

Thank you for this PR.

I understand that this stops the error from appearing in the console. However, this PR only masks a problem. An onEnter/Exit/etc hook that requires resolve data will still be broken. That is why I haven't merged this PR.

Also, the release files should not be included in the PR.

christopherthielen commented 8 years ago

Should be fixed in e401776b480f8fd29fca049aa9f42df0732f6443

Please try 0.1.1 version