-
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
ui-sref-active causes a lot of extra digest cycles #2777
Comments
The $timeout is apparently a fix for #1997 |
Do you have 12 elements/classes that are being applied? I wonder if there is a way to queue them all to fire at the same time but I'm not sure. Also, I think the digest cycles might happen anyway without the timeout? |
Thanks for quick response! I've created a Plunker with a very simple example: Just open the browser console and click on a, b, c or d. 6 Digest cycles are performed. 4 because of the timeout. If you replace by in ui-router.js only 2 cycles are necessary. |
I think we do really need |
I think we can use |
Fixed by using |
The $timeout in ui-sref-active directive causes a lot extra digest cycles. In our case 12!
function addClass(el, className) { $timeout(function () { el.addClass(className); }); }
Do we really need $timeout? At least removeClass does not use $timeout.
The text was updated successfully, but these errors were encountered: