|
1 | 1 | angular-multi-select-tree
|
2 | 2 | =============================
|
3 | 3 |
|
4 |
| -A native Angular multi select tree. No JQuery. |
| 4 | +Lightweight Angular multi select tree directive with arbitrary depth. |
| 5 | + |
| 6 | +Size gzipped 3kb. |
5 | 7 |
|
6 | 8 | #### Demo Page:
|
7 | 9 |
|
8 |
| -[Demo] (http://a5hik.github.io/angular-multi-select-tree) |
| 10 | +[Demo] (http://KristjanLiiva.github.io/angular-multi-select-tree) |
9 | 11 |
|
10 |
| -#### Features: |
| 12 | +#### Dependencies not included in dist |
| 13 | +* Angular - tested with 1.5.x but should work starting from 1.3.x |
| 14 | +* Bootstrap (only css) - tested with 3.x |
11 | 15 |
|
| 16 | +#### Features |
| 17 | +``` |
| 18 | +<multi-select-tree |
| 19 | + data-input-model="[{'id':'','name':'',children:[]}]" |
| 20 | + multi-select="true" |
| 21 | + data-output-model="selectedItem" |
| 22 | + data-default-label="Nothing selected" |
| 23 | + data-callback="selectOnly1Or2(item, selectedItems)" |
| 24 | + data-select-only-leafs="false" |
| 25 | + data-switch-view-label="test1" |
| 26 | + data-switch-view="true"> |
| 27 | +</multi-select-tree> |
| 28 | +``` |
12 | 29 |
|
13 |
| -##### Usage: |
| 30 | +#### Download: |
14 | 31 |
|
15 |
| -``` |
16 |
| -Make sure to load the scripts in your html. |
| 32 | +Download dist and include |
17 | 33 | ```html
|
18 |
| -<script type="text/javascript" src="../dist/angular-multi-select-tree-0.1.0.js"></script> |
19 |
| -<script type="text/javascript" src="../dist/angular-multi-select-tree-0.1.0.tpl.js"></script> |
20 |
| -<link rel="stylesheet" href="../dist/angular-multi-select-tree-0.1.0.css"> |
| 34 | +<script type="text/javascript" src="../dist/angular-multi-select-tree.js"></script> |
| 35 | +<link rel="stylesheet" href="../dist/angular-multi-select-tree.css"> |
| 36 | +``` |
21 | 37 |
|
| 38 | +NPM (the module is not published but can be installed from github) |
| 39 | +``` |
| 40 | +"angular-multi-select-tree": "git+https://[email protected]/KristjanLiiva/angular-multi-select-tree.git" |
22 | 41 | ```
|
23 | 42 |
|
24 |
| -And Inject the sortable module as dependency. |
| 43 | +Include it in the usual ways, and inject |
| 44 | +```js |
| 45 | +import multiSelectTree from 'angular-multi-select-tree'; |
| 46 | +angular.module('app', ['multi-select-tree']); |
| 47 | +``` |
25 | 48 |
|
| 49 | +Example for loading CSS using webpack |
| 50 | +webpack.conf |
| 51 | +```js |
| 52 | +resolve: { |
| 53 | + modules: ['node_modules', 'src'], |
| 54 | + alias: { |
| 55 | + 'angular-multi-select-tree.css': path.join(__dirname, '../node_modules/angular-multi-select-tree/dist/angular-multi-select-tree.css') |
| 56 | + } |
| 57 | + } |
26 | 58 | ```
|
27 |
| -angular.module('xyzApp', ['multi-select-tree', '....']); |
| 59 | +and require in your project |
| 60 | +``` |
| 61 | +require('angular-multi-select-tree.css'); |
28 | 62 | ```
|
29 | 63 |
|
30 |
| -###### Html Structure: |
31 |
| - |
32 |
| -TBD |
33 |
| -Define your callbacks in the invoking controller. |
| 64 | +#### Development |
| 65 | +See package.json for available commands |
34 | 66 |
|
35 |
| -##### License |
| 67 | +#### License |
36 | 68 |
|
37 | 69 | MIT, see [LICENSE.md](./LICENSE.md).
|
0 commit comments