title: AngularJS ng-file-upload not working inside ng-repeat
body: <p>I have directive "notes" which is basically a notes widget that I can add on any page and just add a name and id to it to allow people adding notes to that item.</p>
  
  <p>The users should be able to upload files to their notes using <a href="https://github.com/danialfarid/ng-file-upload" rel="nofollow">ng-file-upload</a> as well now but I struggle to get the <code>$scope.files</code> populated by the ng-file-upload directive. I'm pretty sure it is as usual something stupid with the scope but I can't figure it out.</p>
  
  <p>So any idea why $scope.files gets not populated when I select a file? </p>
  
  <p><strong><a href="http://plnkr.co/edit/QRWBmmSDEjgRH2N0OBEF" rel="nofollow">Plunker Link</a></strong></p>
  
  <p><strong>Directive:</strong></p>
  
  <pre><code>angular.module('app').directive('notes', [function () {
      return {
          restrict: 'E',
          templateUrl: 'notes.html',
          scope: {
              itemId: '@',
              itemModel: '@'
          },
          controller: ['$scope', 'Upload', function($scope, Upload) {
              $scope.files = [];
              $scope.notes = [
                {title: 'first title'},
                {title: 'second title'}
              ];
  
              $scope.$watch('files', function (files) {
                  console.log(files);
                  $scope.formUpload = false;
                  if (files != null) {
                      for (var i = 0; i &lt; files.length; i++) {
                          $scope.errorMsg = null;
                          (function (file) {
                              uploadUsingUpload(file);
                          })(files[i]);
                      }
                  }
              });
  
              function uploadUsingUpload(file) {
                  file.upload = Upload.upload({
                      url: '/api/v1/notes/upload_attachment',
                      method: 'POST',
                      //headers: {
                      //  'my-header': 'my-header-value'
                      //},
                      //fields: {username: $scope.username},
                      file: file,
                      fileFormDataName: 'file'
                  });
  
                  file.upload.then(function (response) {
                      $timeout(function () {
                          file.result = response.data;
                      });
                  }, function (response) {
                      if (response.status &gt; 0)
                          $scope.errorMsg = response.status + ': ' + response.data;
                  });
  
                  file.upload.progress(function (evt) {
                      // Math.min is to fix IE which reports 200% sometimes
                      file.progress = Math.min(100, parseInt(100.0 * evt.loaded / evt.total));
                  });
  
                  file.upload.xhr(function (xhr) {
                      // xhr.upload.addEventListener('abort', function(){console.log('abort complete')}, false);
                  });
              }
  
          }]
      };
  }]);
  </code></pre>
  
  <p><strong>Template:</strong></p>
  
  <pre><code>&lt;ul&gt;
    &lt;li ng-repeat="note in notes"&gt;
      {{note.title}}
      &lt;div ngf-select ng-model="files"&gt;&lt;b&gt;upload&lt;/b&gt;&lt;/div&gt;
    &lt;/li&gt;
  &lt;/ul&gt;
  &lt;pre style="border: 1px solid red;"&gt;{{files | json}}&lt;/pre&gt;
  </code></pre>