Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<html ng-app="app">
  <head>
    <meta name="description" content="Get instance of a handsontable">
    <script src="https://handsontable.github.io/ngHandsontable/node_modules/angular/angular.js"></script>
    <script src="https://docs.handsontable.com/pro/1.8.2/bower_components/handsontable-pro/dist/handsontable.full.js"></script>
    <link type="text/css" rel="stylesheet" href="https://docs.handsontable.com/pro/1.8.2/bower_components/handsontable-pro/dist/handsontable.full.min.css">
    <script src="https://handsontable.github.io/ngHandsontable/dist/ngHandsontable.js"></script>
  </head>
  <body>
    <div ng-controller="MainCtrl as ctrl">
      <hot-table hot-id="mytable" datarows="ctrl.db.items"></hot-table>
        <button ng-click="ctrl.count()">get</button>
        <span>{{ ctrl.data }}</span>
    </div>
  </body>
</html>
 
function MainCtrl(hotRegisterer) {
  this.db = { items: [[5, 6], [7, 8]] };
  
  this.count = function () {
    var hot_instance = hotRegisterer.getInstance("mytable"); 
    this.data = hot_instance.getData();
  }
}
MainCtrl.$inject = ['hotRegisterer'];
angular.module('app', ['ngHandsontable'])
  .controller('MainCtrl', MainCtrl)
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
chengtiepro
0viewers