Hi Mo, It seems we disagree. No problem, I just want to explain something a little deeper. However, you seem to work under the idea that the OP is iterating over the result of the async. That is not the case in OP's question. So your links are not relevant. The $http's are inside the viewed rows. That is a different thing.
On Friday, May 29, 2015 at 10:36:59 PM UTC+2, Mo Moadeli (CREDACIOUS) wrote: > > There is no technical need to do async outside an repeat. > > Sander, the OP, in fact, DOES have an async call ($http) INSIDE an > ng-repeat. THAT is absolutely a no-no . So I'm not clear with what you are > saying. > Well, I'm saying that it is an real possibility.* Definitively not a no-no*! The sample of the OP is perhaps more suited to your solution, but that does not make it the only option. If your UI becomes more complex (and they tend to...), you can have the situations that you need to resolve some promises inside a repeater. For example, in this example, the result table has an 'expand' button that only exposes the thumbnail when the user takes some action (clicks the expand button...). So you only need the thumbnail if it is view-able. You solution would mean that every thumbnail is fetched, whether it is viewed or not. Or the result is paginated, do you still need all the thumbnails? As a side-note, I seldom see an API that can deliver multiple URL's at once. I'm fairly sure the big providers like google, vimeo, MS, will never provide such an interface for thumbnails (Technically, it becomes very hard to spread such a call over multiple server instances, so this would create a very big demand on a single instance, and they do not like that. For good reasons!) Another note, async has noting to do with threads. Don't believe me, google around, or read some browsers code. Do not refer to this as it being another thread, or if you do, do say you can use it as an thinking model. It has similarities alright, but it is not how it works in most browsers. Regards Sander -- 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.
