title: Angular $scope conflict with file input type
body: <p>I was trying to convert a file to byte array using angularjs. its working fine, also add the byte code and filename to an array($scope.FileAttachments), and when it'll be added to $scope.FileAttachments client side ng-repet will display the attached file. file conversion done, file added to $scope.FileAttachments also done, but ng-repeat not working at right time. interesting issue is that, when any other event happened inside the view, ng-repeat working nicely. </p>
  
  <p><strong>HTML Code</strong></p>
  
  <pre><code>&lt;input id="File1" ng-model="File1" onchange="angular.element(this).scope().file1Upload()" type="file" /&gt;
  
  &lt;table  class="table table-striped table-bordered table-list"&gt;
      &lt;thead&gt;
          &lt;tr&gt;
               &lt;th&gt;Name&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody id="tblAttachments"&gt;
           &lt;tr ng-repeat="item in FileAttachments  track by $index"&gt;
               &lt;td&gt;{{item.AttachmentDescription}}&lt;/td&gt;
            &lt;/tr&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p><strong>AngularJS Controller's Code</strong></p>
  
  <pre><code>$scope.FileAttachments = [];
  var fileData;
  
  function getBuffer(resolve) {
       var reader = new FileReader();
       reader.readAsArrayBuffer(fileData);
       reader.onload = function () {
            var arrayBuffer = reader.result
            var bytes = new Uint8Array(arrayBuffer);
            resolve(bytes);
       }
  }
  
  
  $scope.file1Upload=function() {
       var files = document.getElementById("File1").files;
       fileData = new Blob([files[0]]);
       var promise = new Promise(getBuffer);
       promise.then(function (data) {
            $scope.FileAttachments.push({
                "AttachmentDescription": files[0].name.toString(),
                "FileValue": data.toString()
            });
       }).catch(function (err) {
            console.log('Error: ', err);
       });
  }
  </code></pre>