RafaelVidaurre / angular-permission

Simple route authorization via roles/permissions
MIT License
1.13k stars 212 forks source link

Back button broken when returning promises on resolve #406

Closed javier-vilares closed 7 years ago

javier-vilares commented 7 years ago

Example 1: Wrong order

With angular-permission: https://plnkr.co/edit/Llc8Z7CAY88lFxH9Yagq?p=preview

Without angular-permission: https://plnkr.co/edit/njqru8bSpw7SiRNeRBL5?p=preview

Example 2: Infinite loop

With angular-permission: https://plnkr.co/edit/HBp6wSW5ooewk0MEiazM?p=preview

Without angular-permission: https://plnkr.co/edit/HBp6wSW5ooewk0MEiazM?p=preview

I´ve tried different versions of the libray and it seems the problem always existed. Is there any workaround to this problem?

Thanks for spending your time making this awesome library @masterspambot :D

masterspambot commented 7 years ago

Example 1: Wrong order Notice that in case when you use resolve ui-router re-applying resolve function messing with order in history. If you cache your request everything is fine. Generally avoid using resolve function. Use services to make those calls instead. Fixed sample: https://plnkr.co/edit/tcq9uRmthZeQ3mSfCrHx?p=preview

Example 2: Infinite loop I see no loop here....

Eduardo-Julio commented 7 years ago

We have this same problem but we cant avoid using resolve, does anyone have been able to fix this?

javier-vilares commented 7 years ago

@Eduardo-Julio Updating ui-router version to >= 1.0.0 solves the problem.