-
Notifications
You must be signed in to change notification settings - Fork 3k
state transition performed twice when using optional state parameters #1396
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
Comments
I think I've seen this as well. Will you please make a plunk? |
Here is the plunkr: As soon as I added the ID parameter to the URI (route1/:id) the controller is called twice |
Here's what's happening:
patched plunk with fix from #1424 |
Thank you Chris for digging into that issue! |
hi, i'm also experiencing this using routeProvider, '/page/:id?' has this fix also addressed routeProvider as well? |
Hi, I'm seeing this when using version 0.2.13. Instead of using ui-sref I have am using ng-click to call a function which then calls $state.go(). I can also confirm this when using $state.transitionTo(). ng-click="selectAlert(alert) var selectAlert = function(alert){ Does this bug still exist or am I using this incorrectly? |
I had same problem like @nolandubeau . version is 0.2.11. Seems to be fixed in 0.2.14. |
i am still getting the same problem in 0.2.15 ,is the problem fixed or still persist ,please help me with this one |
I also am getting this problem in 0.2.15. I am using custom types in my solution. |
Please make a plunker |
+1, have the same problem in 0.2.15. |
its working fine with 0.2.14, |
Ok, nevermind, it was a problem of implementation of my login router. In fact I did it in my $stateChangeStart and it didn't end well. So I think I have to move this out in another listener. |
I agree with @pranaydutta89; for me using version 0.2.14 instead if 0.2.15 fixes my issue. |
@christopherthielen I have a Plunkr which demonstrates what I'm trying to do to make some sort of dynamic parameters work in 0.2.15. http://plnkr.co/edit/Yeex1Rmd1nWQvdrxj87N?p=preview. It works to change parameters syncronously, but not via a $timeout. |
Im getting this problem in 0.2.15. Using 0.2.14. fixed the problem to me. |
+1 Same for me, I had to go back to 0.2.14 to fix the problem |
+1 Same here |
Actually it's also happening in the version 0.2.14 even though this version looks more stable than the 0.2.15. |
Can confirm this for version 0.2.15. When using nested views and a parameter is present in ui-sref, then the parent resolve function is fired for a second time. Removing the parameter makes it work as expected. |
Can also confirm on 0.2.15 |
@bryanerayner Thanks for the plunker, but this ticket is about "state transition performed twice when using optional state parameters". Your plunker is demonstrating some other issue with reloadOnSearch (we only seem to support one level of reloadOnSearch at a time). Dynamic parameters are scheduled for the 1.0 release. Also, you should use inherit: true so you don't lose your current parameters. |
To the rest of you who have +1'd or said "me too", I need you to reproduce this double-transition issue in a plunker. This ticket is closed, the original issue was resolved, and I don't have any usable information to go on to fix the +1s |
Im getting this problem in 0.2.15. |
When optional state parameters are defined for a state, the state transition is performed twice as long as the optional parameters.
The $stateParams of a controller that was called twice look like this:
First: {offset: undefined, limit: undefined, sort: undefined, sortby: undefined}
Second: {offset: 0, limit: 20, sort: "asc", sortby: "title"}
Note that all state parameters are optional and defined like this.
When I use ui-sref without any parameter the controller is called twice.
Products
Using all state parameters the controller is called only once.
Products
IMHO this is a bug and I hope somebody can fix it as all controllers with optional parameters and API calls make API requests twice.
The text was updated successfully, but these errors were encountered: