title: Access TypeScript functions from JavaScript
body: <p>I want to use TypeScript with jsTree. How can I call the <code>setCurrentNode</code> function in the bound jsTree function?</p>
  
  <pre><code>class MyController {
      thescope: any;
      static $inject = ['$scope'];
  
      constructor($scope) {
          $scope.vm = this;
          this.thescope = $scope;
  
          (&lt;any&gt;$("#demo2")).jstree({
               .bind("select_node.jstree", function (e, data) {
                // how can I call setCurrentNode(data) here?
               }
          });
  
      }
  
  
      setCurrentNode(node: any): any {
          ... // do Stuff in this typescript function
      }
  }
  </code></pre>