JavaScript Double state change in ui-router when using $state.go in $stateChangeStart

Here's my plunker. If you click on the profile link and look at the generated state change list:

stateChanges = [
  " -> home",
  "home -> profile",
  "home -> signIn",
  "signIn -> signIn"
]

you can see there's an unexpected extra state change "signIn -> signIn".

I've done some debugging and it seems it's ui-router's reaction to $locationChangeSuccess via the afterLocationChange function. But I'm not sure if that's a bug in ui-router or a result of how I configured ui-router and how I manage redirection. If the behavior is my fault, how do I fix it?

I would really appreciate the help, as the double state change causes my query parameters to be double URL encoded: /profile -> %2Fprofile -> %252Fprofile instead of just the first two.

UPDATE

It seems this is something that came with 0.2.15. I tried using older releases and even 0.2.14 works fine. After some investigation I found the problem came with commit 48aeaff. If I uncomment the code that was commented out by that commit, this issue goes away even on 0.2.15. For now I will use this modified version of the 0.2.15.

I also found that there's an issue in ui-router's issue tracker for this #1573.

Answer:1

Trying to understand the behaviour and difference between: moment.utc(date) and moment(date).utc() Using '2018-05-31' as a param: moment.utc('2018-05-31').format() will give: ‌2018-05-31T00:00:...

Trying to understand the behaviour and difference between: moment.utc(date) and moment(date).utc() Using '2018-05-31' as a param: moment.utc('2018-05-31').format() will give: ‌2018-05-31T00:00:...

  1. difference between moment and torque
  2. difference between moment of inertia and polar moment of inertia
  3. difference between moment and momentum
  4. difference between moment arm and lever arm
  5. difference between moment of inertia and rotational inertia
  6. difference between moment and moment of inertia
  7. difference between moment and minute
  8. difference between moment and work
  9. difference between moment and bending moment
  10. difference between moment and couple
  11. difference between moment and shear connection
  12. difference between moment and moment-timezone
  13. difference between moment of inertia and area moment of inertia
  14. difference between moment of inertia and section modulus
  15. difference between moment of force and torque
  16. difference between moment of inertia and second moment of area
  17. difference between moment and central moment
  18. difference between moment and torque pdf
  19. difference between moment frame and braced frame
  20. difference between moment and movement

I am working on a React app that is 'remote controlled' and am trying to connect the app's tab navigation via Pusher. I am using react-router-dom and have set up my connection to Pusher and the ...

I am working on a React app that is 'remote controlled' and am trying to connect the app's tab navigation via Pusher. I am using react-router-dom and have set up my connection to Pusher and the ...

  1. react router programmatically change route
  2. react router programmatically change route hooks
  3. react router programmatically link
  4. react router programmatically change route v4
  5. react router programmatically call link
  6. react router programmatically route
  7. react router programmatically change route 2019
  8. react router programmatically
  9. react router programmatically change url
  10. react-router programmatically change
  11. react routing programmatically
  12. react-router-dom programmatically change route
  13. react router 4 programmatically change route
  14. react router dom programmatically redirect
  15. react router v4 programmatically navigate
  16. react-router-dom programmatically navigate
  17. react router push programmatically
  18. react-router-redux programmatically navigate
  19. react router 5 programmatically change route
  20. react router 3 programmatically change route

I have a temperature scale (green up to some extent, then yellow and then red) in the background and need a temperature "bar" of sorts over it which: Refreshes after a fixed interval of time, in the ...

I have a temperature scale (green up to some extent, then yellow and then red) in the background and need a temperature "bar" of sorts over it which: Refreshes after a fixed interval of time, in the ...

  1. make div change width
  2. make padding not change width

When writing a gallery faced with a problem. There is pagination for the gallery. Each page should be different picture. As with the aid of AJAX upload new content to the gallery when switching pages? ...

When writing a gallery faced with a problem. There is pagination for the gallery. Each page should be different picture. As with the aid of AJAX upload new content to the gallery when switching pages? ...

  1. load content with ajax
  2. load content with javascript
  3. load content with jquery
  4. load content with ajax wordpress
  5. load content without page refresh
  6. load content with ajax jquery
  7. load content with scroll
  8. load content from url jquery
  9. load content in iframe
  10. load content in div jquery
  11. load content from another page javascript
  12. load content in div
  13. load content from url javascript
  14. load content in iframe jquery
  15. load content in div ajax
  16. load content from url jquery ajax
  17. load content from file php
  18. load content from url php
  19. load content from file javascript
  20. load content from file c#