Light Angular Component that wraps jstree library.
0 people use it
Author: 2677390?v=3 avim101


Light Angular Component that wraps jsTree library.


The amJsTree depends on the following libraries: * jquery >= 1.9.1 * angular >= 1.5.x * jstree >= 3.3.3 (tested on version 3.3.3 may support older versions as well)


You can install the amJsTree via bower:

or via npm: bat npm install am-js-tree --save

or you can add the amJsTree.min.js file to your HTML page: html <script src="jquery.js"/> <script src="angular-1.5.x.js"/> <script src="jstree.min.js"/> <script src="am-js-tree.min.js"/>

Add the amJsTree to your module dependencies


The main purpose for this wrapper is to integrate easily jsTree in your angular application and work with the jsTree api exactly as if you were using the jquery plugin. this wrapper is a very simple component that registers your selected jsTree/jsTree plugins event and attaches them to your controller. NO WATCHERS!

You can find the jsTree documentation at this link


  • config - This is the configuration object of the jsTree, if you will not supply one, an empty one will be created (not mandatory).

Registering for events

You can register a callback to any Js Tree and plugins event:

  • events - Add the events object and specify the name of the events to register for, And a callback for each event in the following event's format e.g

The cb function will always contain two arguments: * event - the event * data - an object that contains all arguments that return from jsTree event

Example: html <am-js-tree config="$ctrl.jsTreeConfig"></am-js-tree>

Using the Js Tree API from your controller

  • jsTree instance is an object that contains the list of events with the callback objects.

Example: html <am-js-tree config="$ctrl.jsTreeConfig"></am-js-tree>



comments powered by Disqus
This page was last updated over 1 year ago.