BTW, the solution is in the last plunkr fork/version. Also, what I provided was simply a 'fix'. As a general rule $http calls are within singleton AngularJS services and not inside controllers.
On Friday, May 29, 2015 at 2:57:57 PM UTC-4, Mo Moadeli (CREDACIOUS) wrote: > > I spent a few minutes and fixed it for you. Plunkr: > http://plnkr.co/edit/LyhSB7Iu64zdAHIsFQsP?p=preview > > The solution is to first remove the getThumbnailURL(video) from with the > ng-repeat which is creating an async clash. > > Then simply move that code to your controller's add(). Within the add() > get your thumbnail using $http and upon success THEN update the videos > array (which will then trigger the ng-repeat). The ng-repeat will now > traverse a simple array no longer making clashing $http/async calls. > > NOTE: To reiterate, the key here is to push the video object to your array > AFTER the async $http completes. > > Mo > > On Friday, May 29, 2015 at 1:19:23 PM UTC-4, Aimery Marsily wrote: >> >> I get one thumbnail per video, but there are many videos. So the >> ng-repeat is to display each videos with one thumbnail. >> > -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
