-
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
location 'replace' not working #1007
Comments
So, has anyone tried 'replace' and knows if that works? |
Can you post a plunkr that demonstrates the issue? |
I am also seeing this behavior with release v0.2.8 (2014-01-16) |
Seeing this in v0.2.10 |
Also seeing this is v0.2.10 Edit: Also seeing this is v0.2.11 |
I'm withdrawing my endorsement of this issue. Trying to replicate the issue in Plunkr revealed a bug in my code that was no fault of ui-router. |
I see the same behavior. |
Post a plunkr or this won't be addressed. |
I'm seeing the same thing. I'll see if I can't put replicate in plunkr. Funny, I just create a plunkr/issue for ember for their replace functionality. |
Here's a plunkr http://embed.plnkr.co/1mykz3/preview.
If I repeat the last two steps, the route will no longer go back to route 0. EditI replaced |
Ping, are people able to see the issue with this plunkr? |
I wasn't able to, but I am seeing this issue in my app. I'm using ui-router-extras future states, not sure if that has anything to do with it. |
@FreakTheMighty I am able to see the issue in your plunkr. |
In case someone else hits this: I discovered it was being caused by (Also: note that permissions is inherited, so to see that removing permissions fixes the issue, you may need to set |
As a follow up, I really don't see a practical solution to this issue unless ui-router passes I think the event broadcasts should be updated to |
For anyone using Ionic, there's a separate issue with their Back button. There's a couple of quite hacks in this issue: |
I agree with @OverZealous, there really needs to be a way to access the options passed to ui-sref-opts, I am currently stuck as I need to interrupt a state change and then continue later on, but there is no way for me to find out whether I passed any options with the state change. |
I'll accept a PR that adds options as param #5 to state events |
@OverZealous Thanks! |
I was getting the same error as @FreakTheMighty plunkr. Found a simple, albeit hacky workaround - put a slight delay on the $state.go using $timeout e.g. 10ms so that it happens after the first state transition completes. |
|
@nateabele and how do you solve this issue using |
Sorry for adding noise, but $state.go("state.name", {param: param}, {location: 'replace'}); is replacing the current state with the new state for me, which is what I expected, so the back button then goes from the new state to the previous state, skipping the current state. Recommend closing, since there's been no plunkr/jsfiddle in over 18 months, and two people have eliminated angular-ui-router as the cause of their manifestation of this issue. :) |
still not wokring +1 |
1 similar comment
still not wokring +1 |
still not working ++ |
I think the issue most people run into here is passing |
still not working +++ |
These comments are not helpful. Post a plunker demonstrating that it's not working. http://bit.ly/UIR-Plunk As far as I can tell, |
Still not working ++++ I appreciate the effort you put on developing this open source tool, but please, if many people say this feature does not work, at least take the time to verify it properly, otherwise who is going to rely on it? I modified your plunkr to show the case when it doesn't work: when you programmatically call There you can see how states are pushed into the history despite the "replace" intention, and you can still go back to them: https://plnkr.co/edit/i3R8jaRS6TrMz3KKHT10?p=preview |
@inad9300 here's an updated plnkr with the state.go pieces split out from the template, and using Seems to work for both the buttons and the select box examples. |
My mistake, sorry. So apparently it works after all :) Thanks for taking the time! |
@inad9300 next time please be considerate of the amount of time OSS maintainers spend. Snarky comments like "Still not working ++++" make me reconsider my involvement in OSS.
I couldn't reproduce the issue. I posted a WORKING EXAMPLE. Issues without reproductions are very frustrating. I appreciated that you posted the plunker though 👍 |
I had the same issue and after research i have realized i was wrongly understanding the concept of replace. |
Has this problem been solved? I'm using ui-router v0.2.13 along another group of dependencies (which I unfortunately cannot post here) and I'm facing the problem 😢 What I have here is: I have a list of objects, and clicking in an object on the list redirects me to an intermediary screen with a When I click the navigator button once it works and I go to the previous screen, but clicking twice keeps me on the previous screen after a redirecting... My exact code is PS: Sorry for my bad english, it isn't my home language, and I'm not used to technical terms |
I'm doing a transition to the same state (different params) and I intend to NOT keep this transition in history, so I did
But when I go back it still goes through all the previous states.
The text was updated successfully, but these errors were encountered: