-
Notifications
You must be signed in to change notification settings - Fork 352
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
Prevent $digest cycle to trigger on UpdateTime #263
Comments
You can override the API.onUpdateTime method: Probably you will have some problems, specially with views that use time values (vgTimeDisplay, vgScrubBarCurrentTime, etc...). |
I've run into the same problem. Especially in conjunction with the updateTime interval in videogular-youtube, which triggers I understand the side effects though of removing it completely as explained by @2fdevs. On the other hand, this is really a major issue and I think the design needs to be re-thought to overcome the side effects of removing I've resorted to maintain a patched version of videogular for the time being with the digest loop call removed. |
@alexthewilde I understand that this is an issue but it is hard to solve in Angular 1, and the only thing that it comes to my mind needs a major refactor to make $digest instead of $apply. Now I'm focused on v2 with ng2 which it should be the future and I'm not willing to make any major refactor now or breaking change to v1. My recommendation as I said is to patch videogular in a custom fork or override API.onUpdateTime with your custom implementation. Thanks for understanding. |
@Elecash makes total sense. I'll maintain a custom fork of v1 as you suggested since performance is a dealbreaker for me here. |
@alexthewilde Does you code mean that if I write:
with: Thanks |
@aug-riedinger Did you figure out how to do this? I'm having a similar problem in one of my apps. |
After investigating in the videogular source code and regarding the fact that the angular v1 version is no longer maintained, I think I'll import this controller's code into my project and handle it manually (there are a lot of event listeners I don't need etc.). If I achieve doing this + I feel a lot of performance improvement, I'll report my code here. |
Cool thanks 👍 |
hi @aug-riedinger, my solution was to replace |
@alexthewilde that is indeed an easy and fast fix, probably I'll add to close this thing forever. Thanks for the suggestion! |
That sounds like an interesting solution indeed. If it were to change the If I look at my
|
I'm working right now in the simple fix provided by @alexthewilde but if you want to send after the new release an improvement I'm glad to review your PR 😄 |
Fixed with 74faeb0 |
@Elecash sweet! Are you sure though that using |
...which is not to say that the goal should be to make it work with |
I've tested a little bit and everything seemed to work. In fact, it should work in that way, if there's a bug or other issues should not be related with $parend.$digest but with other problems that are hidden. |
I have quite some performance issues with videogular, because each time the player triggers the
UpdateTime
event, a$digest
cycle is triggered, which in my case result useless calculation.Is there a way to control if the
UpdateTime
event should trigger a$digest
cycle?If not, would it make sense ?
The text was updated successfully, but these errors were encountered: