-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Broken history for longer resolves and menuClose directive #4900
Comments
Hi @talamaska, We decided we aren't going to make any changes to this in V1 unless enough of the community wants to see them. We designed navigation without considering the "resolve" functionality of ui-router, so it can lead to challenges. Some times it works, some times it doesn't. V2's architecture will naturally resolve a lot of these problems. Please let me know if you have any thoughts on the matter. We really appreciate your contributions to Ionic! Thanks, |
Hi, @danbucholtz , I got this from your answer on the original bug report. Btw what do you think about my suggestion of the code altering. Is it going to work that way? |
Type: bug
Platform: all
Last working version of the resolve in ui router is ionic 1.0.0 BETA 1
I'm not going to explain how to reproduce because it was already explained in the bugs I referred to.
So this is continuation of the bug report #3941
After a research that I've made, i have found that there is hardcoded timeout in the menuClose directive - a379bfd,
it was introduced to fix
#4145
#4038
#4132
But it actually introduce a bug #3941
On my opinion there are some problems with this solution and the fix for all those bugs can be more elegant. We all know that timeouts are bad practice, especially when the timeout is with hardcoded time and you don't know when the view will be loaded. It seems that we don't have access from outside to the information when the state data was resolved.
First things first
My solution to this is checking the url of the link in the menu and compare it with the current state. If they are the same, we don't add/change $ionicHistory.nextViewOptions.
in the calling "parent" controller. It maybe not a real parent, but logically your navigation starts from somewhere.
I would add a codepen, but I'm not sure how to demonstrate the change in the ionic source code.
That's why I'm going to paste some code here:
I guess the '#' can be added after checking the setting
if html5Mode is true and what's the actual hashPrefix
In the playlist controller (assume sidemenu start app)
The text was updated successfully, but these errors were encountered: