title: How to pass the selected $index in ng-repeat?
body: <p>I want to upload image and show up in the page. I have 5 image so there is 5 arrays and I'm using ng-repeat to show it out.</p>
  
  <p>Below is my html in jade form:</p>
  
  <pre><code>                form.form-horizontal       
                      .form-group(ng-repeat="runningText in runningTexts")
                          .col-md-3
                              label.control-label Image {{$index+1}}
                              .image-upload-area.label-centerleft
                                  p(onclick="$('#imageFile').click()") Click me to change
                                  img.loading(ng-show="isUploading" src="/img/loading.gif")    
                                  img.img-responsive.clickable(ng-src="{{runningText.image != '' ? '/img/' + runningText.image : '/img/logo_d.png'}}")                                    
  
                  form#imageUpload(enctype="multipart/form-data" action="/api/admin/display/image" ng-upload="uploadDone(content)" method="post")
                      input#imageFile(type="file" name="image" onChange="$('#imageSubmit').click();return false;" style="display:none")
                      input#imageSubmit(type="submit" ng-click="isUploading = true"  style="display:none") 
  </code></pre>
  
  <p>Below is my controller in my js file:</p>
  
  <pre><code>    loadData = function(){  //page load function
      $http.get(apiPath)
          .success(function(data){  
              if (data != null){       
                  $scope.runningTexts = data.displaySetting.runningText;
              }
          })  
      }  
  
      $scope.uploadDone = function(data) {  // upload finished function
      $scope.runningTexts[0].image = data.path;  // Problem here!!
      $scope.isUploading = false;
  };
  </code></pre>
  
  <p>How do I pass the index that I choose in the html and put it back in the $scope.runningTexts[0].image. Now I'm using 0, so every image I upload will show up in array 0 only. How do I do it if I upload to array 1, or 2 and so on?</p>