-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Using an href of # no longer resets ui-router state #2216
Comments
Updated plunkr with logging, you will notice $stateChangeStart never fires when RESET is clicked. |
Thats not a reset. What exactly are you trying to do? Also, do you have HTML5Mode turned on? |
html5mode is off This used to be working, but no events are fired anymore, basically href="#" is a no-op now. |
Why not use |
We don't want to encode the home state in the view templates, we want the router to use the .otherwise, or .when like it previous did. This allows us to have it run through that logic (as it should) to make the determination of where to go. This was working previously as mentioned, but I didn't see a documented breaking-change so i'm trying to see if this is a ui-router defect. [EDIT] Here is a log of the stateChangeStart with 1.2.28 |
The change occurred in 1.3 and it looks like its angular related. I think they are preventing the default action on locationChangeStart. Again though, what you are trying to do isn't a reset. It worked before by having the whole page reload instead of going to a new state. I still think what you want is |
Closing this as it doesn't seem to be a ui-router bug |
Would you have the background to open up a defect against 1.4.4 angular? I'm not sure what the breaking change was. |
Unfortunately this also breaks browser back navigation. because if you click back and end up at a # starting point, it will not work properly. |
I'm not sure when this broke, but you can see in this plunkr ahref="#" no longer triggers a change
http://plnkr.co/edit/GPpzcBP0Ewc5bH5MZE03?p=preview
You can click the RESET link after making some changes to reset to ahref="#" and nothing happens, previously this did work.
This code would respond to this change;
$urlRouterProvider.when('', '/GOHERE');
This no longer gets triggered when an href="#" is used.
The text was updated successfully, but these errors were encountered: