12

So, the other day, I was working on a Angular Web app which included the YouTube Api. In the event listener, I wrote that when a video ended, a next one would start (from our database).
Guess what. It didn't work.
Then, I wrote a console.log();
It freaking worked! Then, I removed the console.log. It didn't. I tested cases for like half an hour and it still baffles me, why the hell would an output change everything?
devGod works on mysterious ways...

Comments
  • 10
    Yes I do work in mysterious ways!
  • 1
  • 4
    Race conditions? Try a sleep
  • 0
    I have had something similar happen before and it certainly is a mystery.
  • 4
    It's probably a timing thing. Try setTimeout between three videos and see if that works better.
  • 0
    When it were java I would say someone did logic in toString method
  • 1
    It certainly has something to do with angular's digest loop. Most weird things updating/non updating things usually have to do with that
Add Comment