title: Angular in Excel Import
body: <p>I am trying to implement a function to get the value of a table from an Excel file in html.</p>
  
  <p>In my excel-function.html I have:</p>
  
  <pre><code>&lt;script src="https://rawgithub.com/eligrey/FileSaver.js/master/FileSaver.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;div ng-controller="myCtrl"&gt;
      &lt;button ng-click="exportData()" ng-show="(items|filter:{selected: true}).length"&gt;Export&lt;/button&gt;
      &lt;br /&gt;
      &lt;table width="100%"&gt;
              &lt;thead&gt;
                  &lt;tr&gt;
                      &lt;th&gt;&lt;/th&gt;
                      &lt;th&gt;Name&lt;/th&gt;
                      &lt;th&gt;Date&lt;/th&gt;
                      &lt;th&gt;Terms&lt;/th&gt;
                  &lt;/tr&gt;
              &lt;/thead&gt;
              &lt;tbody&gt;
                  &lt;tr ng-repeat="item in items"&gt;
                      &lt;td&gt;&lt;input type="checkbox" ng-model="item.selected" /&gt;&lt;/td&gt;
                      &lt;td&gt;{{item.Name}}&lt;/td&gt;
                      &lt;td&gt;{{item.Date}}&lt;/td&gt;
                      &lt;td&gt;&lt;span ng-repeat="term in item.Terms"&gt;{{term}}{{!$last?', ':''}}&lt;/span&gt;&lt;/td&gt;
                  &lt;/tr&gt;
              &lt;/tbody&gt;
          &lt;/table&gt;
      &lt;div id="exportable" style="display:none"&gt;
          &lt;table width="100%"&gt;
              &lt;thead&gt;
                  &lt;tr&gt;
                      &lt;th&gt;Name&lt;/th&gt;
                      &lt;th&gt;Date&lt;/th&gt;
                      &lt;th&gt;Terms&lt;/th&gt;
                  &lt;/tr&gt;
              &lt;/thead&gt;
              &lt;tbody&gt;
                  &lt;tr ng-repeat="item in items|filter:{selected: true}"&gt;
                      &lt;td&gt;{{item.Name}}&lt;/td&gt;
                      &lt;td&gt;{{item.Date}}&lt;/td&gt;
                      &lt;td&gt;&lt;span ng-repeat="term in item.Terms"&gt;{{term}}{{!$last?', ':''}}&lt;/span&gt;&lt;/td&gt;
                  &lt;/tr&gt;
              &lt;/tbody&gt;
          &lt;/table&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>In my excel-export.directive.js I have:</p>
  
  <pre><code>function myCtrl($scope) {
      $scope.exportData = function () {
          var blob = new Blob([document.getElementById('exportable').innerHTML], {
              type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8"
          });
          saveAs(blob, "Report.xls");
      };
  
      $scope.importData = function () {
          var obj = xlsx(file);
  
      }
  
      $scope.items = [{
          "Name": "ANC101",
              "Date": "10/02/2014",
              "Terms": ["samsung", "nokia", "apple"]
      }, {
          "Name": "ABC102",
              "Date": "10/02/2014",
              "Terms": ["motrolla", "nokia", "iPhone"]
      }]
  }
  </code></pre>
  
  <p>But I do not know how to get the excel file in the angular.</p>
  
  <p>I'm not sure I should be put on how td reads the excel file.</p>
  
  <p>How to import an Excel file, you wonder if you can put the value of the file in scope.</p>