question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

$stateChangeStart is firing multiple times

See original GitHub issue

I was having issues with page loading bars in my app acting a little crazy. After a bit of debugging, I’m finding that $stateChangeStart is being broadcasted multiple times, which is seriously confusing our loading bars and a few other components that depend on that event.

As soon as I removed angular-permission from the single page app, everything worked as normal and $stateChangeStart* just fired once on each state load.

Is this expected functionality, since angular-permission must stop the state change to check permissions, or this is a bug?

I’m going to do some more debugging and I’ll post more later. Just wanted to get the issue logged before I get off work. Thanks in advance for your help!

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:2
  • Comments:7

github_iconTop GitHub Comments

1reaction
masterspambotcommented, May 30, 2017

As it is known problem, the olny solution I would recommend is migration to ui-router 1.x (that is not that hard as it seems).

0reactions
hadiamiricommented, May 30, 2017

Hello @masterspambot I have the same problem here, I am working on a very large app which depends a lot on $stateChangeStart and $stateChangeSuccess, we are using a loading overlay for state transitions, after adding angular-permission this loading overlay is not shown, what is the solution and how should I solve it? I am using ui-router version 0.2.15 and angular-permission version 5.3.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is $stateChangeStart triggering multiple times?
I am trying to use $stateChangeStart with ui router in a controller. It seems like everytime it's fired, the callback fires +1 times...
Read more >
$stateChangeStart is firing multiple times · Issue #192
I was having issues with page loading bars in my app acting a little crazy. After a bit of debugging, I'm finding that...
Read more >
Why is $stateChangeStart triggering multiple times
I am trying to use $stateChangeStart with ui router in a controller. It seems like everytime it's fired, the callback fires +1 times...
Read more >
$stateChangeStart won't fire up, but $locationChangeStart ...
Hey,. I have a login function in my ctrl, after the user successfully logged in, he gets redirected to 'home' state. $state.go('home').
Read more >
Enforcing login at app startup - ionic-v1
The problem actually wasn't the event $stateChangeStart not being fired at startup. The problem is that it's fired multiple times but only ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found