title: Pass angularJS $index into onchange
body: <p>I have an input file within a ng-repeat in my angularJS app. I need to pass the $index variable to the onchange attribute. I'm using onchange and not ng-change because I need the uploaded object (<a href="https://stackoverflow.com/questions/20146713/ng-change-on-input-type-file">see this post</a>)</p>
  
  <p>In the following code I get 'Uncaught ReferenceError: $index is not defined' </p>
  
  <p>Jade code sample:</p>
  
  <pre><code>div.input-group(ng-repeat='filename in filenames track by $index') 
      input(type='file', onchange="angular.element(this).scope().file_changed(this.files, **$index**)")
  </code></pre>