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:
npm install am-js-tree --save
or you can add the amJsTree.min.js file to your HTML page:
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
Using the Js Tree API from your controller
jsTree instanceis an object that contains the list of events with the callback objects.