Lightweight Angular multi select tree directive with arbitrary depth.
Size gzipped 3kb.
[Demo] (http://KristjanLiiva.github.io/angular-multi-select-tree)
- Angular - tested with 1.5.x but should work starting from 1.3.x
- Bootstrap (only css) - tested with 3.x
<multi-select-tree
data-input-model="[{'id':'','name':'',children:[]}]"
multi-select="true"
data-output-model="selectedItem"
data-default-label="Nothing selected"
data-callback="selectOnly1Or2(item, selectedItems)"
data-select-only-leafs="false"
data-switch-view-label="test1"
data-switch-view="true">
</multi-select-tree>
Download dist and include
<script type="text/javascript" src="../dist/angular-multi-select-tree.js"></script>
<link rel="stylesheet" href="../dist/angular-multi-select-tree.css">
NPM (the module is not published but can be installed from github)
"angular-multi-select-tree": "git+https://[email protected]/KristjanLiiva/angular-multi-select-tree.git"
Include it in the usual ways, and inject
import multiSelectTree from 'angular-multi-select-tree';
angular.module('app', ['multi-select-tree']);
Example for loading CSS using webpack webpack.conf
resolve: {
modules: ['node_modules', 'src'],
alias: {
'angular-multi-select-tree.css': path.join(__dirname, '../node_modules/angular-multi-select-tree/dist/angular-multi-select-tree.css')
}
}
and require in your project
require('angular-multi-select-tree.css');
See package.json for available commands
MIT, see LICENSE.md.