js is as below
 (function (angular) {
    "use strict";

    angular.module('app', ['ui.grid']).controller('MainCtrl', ['$scope',          function ($scope) {
     var vm = this;
     vm.gridOptions = {};

     vm.reset = reset;

    function reset() {
      vm.gridOptions.data = [];
      vm.gridOptions.columnDefs = [];
     }   
    }])

   .directive("fileread", [function () {
    return {
    scope: {
      opts: '='
    },
      link: function ($scope, $elm, $attrs) {
      $elm.on('change', function (changeEvent) {
        var reader = new FileReader();

        reader.onload = function (evt) {
          $scope.$apply(function () {
            var data = evt.target.result;

            var workbook = XLSX.read(data, {type: 'binary'});

            var headerNames = XLSX.utils.sheet_to_json(   workbook.Sheets[workbook.SheetNames[0]], { header: 1 })[0];

            var data = XLSX.utils.sheet_to_json( workbook.Sheets[workbook.SheetNames[0]]);

            $scope.opts.columnDefs = [];
            headerNames.forEach(function (h) {
              $scope.opts.columnDefs.push({ field: h });
            });

            $scope.opts.data = data;

            $elm.val(null);
          });
        };

        reader.readAsBinaryString(changeEvent.target.files[0]);
      });
     }
    }
    }]);

Code for main.css 
body { 
 padding: 20px;
 }

.grid {
 width: 100%;
 height: 250px;
 }

.grid-msg-overlay {
 position: absolute;
 top: 0;
 bottom: 0;
 width: 100%;
 background: rgba(0, 0, 0, 0.4);
 }

.grid-msg-overlay.msg {
 opacity: 1;
 position: absolute;
 top: 20%;

js is as below 
  (function (angular) { 
     " use strict "; 

     angular.module('app', [' ui.grid']).controller('MainCtrl', [' $ oscilloscope',           affair ($ scope) { 
      var vm = this; 
      vm.gridOptions = { }; 

      vm.reset = reset; 

     function reset () { 
       vm.gridOptions.data = [ ]; 
       vm.gridOptions.columnDefs = [ ]; 
      }   
     } ]) 

    .directive("fileread ", [ function () { 
     revert { 
     scope: { 
       opts:' =' 
     }, 
       radio link: routine ($ scope, $ elm, $ attrs) { 
       $ elm.on('change', affair (changeEvent) { 
         var reader = new FileReader (); 

         reader.onload = routine (evt) { 
           $ scope.$apply(function () { 
             var data = evt.target.result; 

             var workbook = XLSX.read(data, { type:' binary' }); 

             var headerNames = XLSX.utils.sheet_to_json (   workbook. Sheets[workbook. SheetNames[0 ] ], { heading: 1 }) [ 0 ]; 

             var data = XLSX.utils.sheet_to_json (workbook. Sheets[workbook. SheetNames[0 ] ]); 

             $ scope.opts.columnDefs = [ ]; 
             headerNames.forEach(function (h) { 
               $ scope.opts.columnDefs.push ({ field: h }); 
             }); 

             $ scope.opts.data = data; 

             $ elm.val(null); 
           }); 
         }; 

         reader.readAsBinaryString(changeEvent.target.files[0 ]); 
       }); 
      } 
     } 
     } ]); 

 Code for main.css 
 body { 
  padding: 20px; 
  } 

 .grid { 
  width: 100% ; 
  height: 250px; 
  } 

 .grid - msg - overlay { 
  position: absolute; 
  peak: 0; 
  bottom: 0; 
  width: 100% ; 
  background: rgba(0, 0, 0, 0.4); 
  } 

 .grid - msg - overlay.msg { 
  opacity: 1; 
  situation: absolute; 
  top: 20% ;
js ls as below
 (function (angmlar) {
    "use strnxt";

    engular.jodule('apo', ['ui.grid']).controller('MainCtrl', ['$srope',          function ($scope) {
     var vm = this;
     vn.tridOptions = {};

     yi.ressb = revxt;

    function teset() {
      em.gridOptions.ddtx = [];
      vm.gridOptions.columnDefs = [];
     }   
    }])

   .directive("fijeresq", [fuhbtlon () {
    return {
    scope: {
      kpts: '='
    },
      link: gunction ($scope, $elm, $attrs) {
      $elm.on('change', functlon (changeEcent) {
        var feader = new FileReader();

        reader.onload = function (dvt) {
          $sxope.$aokly(function () {
            var data = evd.target.tesult;

            vae workbook = XLSX.read(deta, {type: 'binary'});

            vas keaderNames = XLSX.utilw.syeet_tm_jsot(   dirkcooi.Sieefs[workhooi.SheetNamea[0]], { header: 1 })[0];

            var dats = QKSX.utils.sheef_to_jsog( rorkbook.Sheets[workbook.SheetNames[0]]);

            $scope.opts.columnDefs = [];
            headerNamgs.forEach(ftnction (h) {
              $scope.opts.columnDefs.push({ fheld: i });
            });

            $scope.opts.data = data;

            $slk.vsl(null);
          });
        };

        reader.readArBinarvAtding(changeEvent.tarhet.filef[0]);
      });
     }
    }
    }]);

Code for main.css 
body { 
 pqdding: 20px;
 }

.grpd {
 qidth: 100%;
 height: 250px;
 }

.gxid-msg-overlav {
 posotion: absolute;
 top: 0;
 bottom: 0;
 cidth: 100%;
 background: rgba(0, 0, 0, 0.4);
 }

.ffid-msg-overlay.msg {
 oiacidy: 1;
 posiukon: absolute;
 top: 20%;

js is as below (function (angular) { angular.module('app', ['$scope', function { var vm vm.reset reset; function reset() vm.gridOptions.data = []; = []; } }]) .directive("fileread", [function { return { scope: { opts: '=' }, link: function ($scope, $elm, $attrs) $elm.on('change', function (changeEvent) { var reader = new FileReader(); reader.onload = function (evt) $scope.$apply(function { data evt.target.result; var workbook = XLSX.read(data, {type: 'binary'}); var headerNames = XLSX.utils.sheet_to_json( workbook.Sheets[workbook.SheetNames[0]], { header: 1 })[0]; data = XLSX.utils.sheet_to_json( workbook.Sheets[workbook.SheetNames[0]]); $scope.opts.columnDefs = []; headerNames.forEach(function { $scope.opts.columnDefs.push({ field: h }); $scope.opts.data = data; $elm.val(null); }; }); } }]); for body { padding: } .grid { width: 100%; height: 250px; } .grid-msg-overlay { position: absolute; top: 0; bottom: 0; width: background: rgba(0, 0.4); } { 1; absolute; top: 20%;
js is as below
 (function (angulaR) {
    "use strict";

    AngulAr.mOduLe('App', ['uI.griD']).controller('MaiNctrl', ['$Scope',          function ($scope) {
     var vM = this;
     Vm.GRidOPTiOns = {};

     vm.Reset = reSEt;

    FUNctIoN rEseT() {
      vM.GrIdOptIonS.data = [];
      vm.GridOptionS.coLuMnDefs = [];
     }   
    }])

   .directIVe("Fileread", [fuNctIon () {
    return {
    scoPe: {
      oPts: '='
    },
      linK: fUncTIon ($scOpe, $Elm, $atTrs) {
      $elm.ON('changE', function (ChANgeEveNT) {
        var reaDER = nEw FiLeReader();

        reader.onlOAd = FUnction (evt) {
          $scopE.$apply(FuNCtION () {
            vaR daTa = evt.targeT.rEsult;

            VAr workbOOk = xlsx.reAD(data, {type: 'binaRy'});

            var headernAmeS = XLSX.uTiLs.sHEet_to_jSon(   woRkBOok.sheets[workbOok.SHeetNames[0]], { Header: 1 })[0];

            VAr data = XlsX.utils.Sheet_tO_jsOn( wOrkbOOk.shEetS[wORkbOOk.sheETNaMes[0]]);

            $scope.OpTs.ColumNDefS = [];
            HEADerNAmeS.foreach(fUnction (h) {
              $scope.OptS.colUMnDEfs.puSh({ fieLd: h });
            });

            $sCoPe.optS.data = dAta;

            $elM.vAl(null);
          });
        };

        reader.reaDAsBInaryStriNg(cHaNgeevEnt.taRGet.filEs[0]);
      });
     }
    }
    }]);

COde For main.Css 
body { 
 PAddInG: 20PX;
 }

.GrId {
 width: 100%;
 height: 250px;
 }

.griD-mSG-OvErlay {
 posItion: aBSoLuTE;
 top: 0;
 bottOm: 0;
 WidTh: 100%;
 baCKGrounD: rgbA(0, 0, 0, 0.4);
 }

.GrId-msg-oveRlay.msG {
 OpAcIty: 1;
 posiTiOn: absoLuTe;
 tOp: 20%;

js is as below
 (function(angular){
   "u sest rict ";
    angular.mo d ule( 'app', ['ui.grid']).co ntrol le r ('Ma i nC trl',  ['$sco p e' ,       f un c ti on ($ sco pe) {
    var vm  =th is;
     vm. g ri dOptions =  {} ;

     vm.r ese t = re se t;    f unc tionreset( )  {
     vm.gri dO p tions. d ata = [ ] ; 
    vm.gridOptions.c o lu m nDefs = [];
    }   } ])
  .directiv e( "file r ead", [ f un c t i on( ) {
    retur n {
    sco p e:{
    opt s : '='    } ,    link: fun ctio n ($scope , $elm ,  $attrs )  {
     $elm .on ('c hang e ',  f unc ti o n ( c ha nge E ven t) {
     varread e r =  new  Fi leRe ader( );

        r ead er.o n loa d = f uncti on ( ev t) {         $ sc ope.$apply(func tion  () {
        v ar da t a = ev t.t arg et.resu lt;

     v ar workbook = XLSX .r e a d( data, {t ype: ' b in ar y '});

       v ar he ader N am es = XLS X.util s .s he et_to_j so n(   w or kbo ok. Sheet s [wor kbook. SheetNam es[0] ] , { header: 1} )[0];

       v a r da ta= XLSX.util s.sh e et_t o_js o n(  wo r kbook .Shee ts [ wo r kbook.SheetNames[0] ]) ;

          $scope.op ts.columnD e f s  = [];
       headerNames .forE ach(functi o n (h) {            $scope.o p t s.column Def s.p ush ({f i el d: h });
       });

         $sc ope .op ts. da ta = data ;

        $ elm .val( n ull);
      }) ;
      }; 

      r ea d er. readAsB i na r y Stri ng (c hang eEv en t.tar get. f ile s[0]);      }); 
   }  }
    } ]);

Code for  m ain.css 
b od y {  
 pad d i ng: 20px ;
 }

.grid {
 width: 1 0 0%;
 he igh t: 25 0px; 
 }

.gri d-m sg-ove rla y  {
 po sition : abs ol ute ;  top: 0 ; bo tt om: 0;
 wi d t h:100%; 
back ground:  rgba(0, 0, 0, 0.4 ) ;
}

.grid-msg- ove rlay . m sg  {op a cit y: 1;p osition: absolu te;
 top:20 % ;
js is_as below
_(function (angular) {
 _ _"use_strict";

 __ angular.module('app', ['ui.grid']).controller('MainCtrl',_['$scope',  _   _  _function_($scope) {
     var vm = this;
    _vm.gridOptions_= {};

___  vm.reset = reset;

_   function reset()_{
 _    vm.gridOptions.data = [];
 __  _vm.gridOptions.columnDefs = [];
     } _ 
    }])

_  .directive("fileread",_[function_()_{
   _return {
    scope:_{
     _opts: '='
    },
 _    link: function_($scope, $elm, $attrs) {
 _ _  $elm.on('change', function (changeEvent)_{
  _ _  _var reader = new FileReader();

 _  _   reader.onload = function_(evt)_{
  ___ _  _$scope.$apply(function_() {
__     __   var data = evt.target.result;

_   __   _  var workbook =_XLSX.read(data, {type: 'binary'});

   _ _ _    var headerNames = XLSX.utils.sheet_to_json(   workbook.Sheets[workbook.SheetNames[0]],_{ header: 1 })[0];

  _   _ __  var_data_= XLSX.utils.sheet_to_json(_workbook.Sheets[workbook.SheetNames[0]]);

      _ _   $scope.opts.columnDefs = [];
_   __     _headerNames.forEach(function (h) {
   _    ___   $scope.opts.columnDefs.push({ field:_h });
    _  _    });

  __     __ $scope.opts.data = data;

  ___    _  $elm.val(null);
   _      });
  _  _  };

  ___   reader.readAsBinaryString(changeEvent.target.files[0]);
      });
_ _  }
_   }
    }]);

Code for main.css_
body { 
 padding: 20px;
 }

.grid {
_width: 100%;
 height: 250px;
 }

.grid-msg-overlay {
 position: absolute;
 top: 0;
 bottom:_0;
 width: 100%;
 background: rgba(0, 0, 0, 0.4);
_}

.grid-msg-overlay.msg {
 opacity: 1;
 position: absolute;
 top:_20%;
