Hi Aimery,

Put in a local inside the repeater, and use that. 
Something like this:
 ...
       template:   
                    '<input type="text" ng-model="new" maxlength="150" 
placeholder="Vimeo video URL">' +
                    '<input type="submit" ng-click="add()">' +
                    '<div ng-repeat="video in videos track by $index" 
class="video" ' +
                        'ng-init="local={};getThumbnailUrl(video,local)"' +
                        '<img ng-src="local.tumbnail" class="thumbnail" 
alt="{{ video.source }}" />' +
                    '</div>',
        controller: function($scope, $element, $attrs) {
            $scope.add = function() {
                var data = parseVideoUrl($scope.new);
                
                if (data === null) { return false; }
                
                $scope.videos.push(data);
                $scope.new = "";
            };
            
            
            $scope.getThumbnailUrl = function(video, local) {
              // uncomment the bottom part will make an infinite loop
              $http.get('http://vimeo.com/api/v2/video/' + video.code + 
'.json')
                  .success(function(data, status) {
                      local.tumbnail= data[0]['thumbnail_medium'];
                  });
            };
...

 
Does this help you a bit?
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.

Reply via email to