am-js-tree

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

am-js-tree

Light Angular Component that wraps jsTree library.

Dependencies

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)

Install

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

Documentation

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

Usage

  • 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>

License

MIT

comments powered by Disqus
This page was last updated 3 months ago.