Skip to content

Commit bac1747

Browse files
committed
working version usabl with npm
update readme include dist
1 parent b4d5683 commit bac1747

10 files changed

+351
-485
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ components
44
build
55
.idea
66
.editorconfig
7+
.tmp

Gruntfile.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,17 +117,18 @@ module.exports = function (grunt) {
117117
cssmin: {
118118
css: {
119119
src: '<%= concat.css.dest %>',
120-
dest: 'dist/angular-multi-select-tree-<%= pkg.version %>.min.css'
120+
dest: 'dist/angular-multi-select-tree.min.css'
121121
}
122122
},
123123
clean: ['dist/*']
124124
});
125125

126-
grunt.registerTask('default', ['jshint', 'karma:unit']);
126+
grunt.registerTask('default', ['dev']);
127127
grunt.registerTask('test', ['karma:unit']);
128128
grunt.registerTask('test-server', ['karma:server']);
129129
grunt.registerTask('update-dist', ['clean', 'concat', 'ngtemplates']);
130-
grunt.registerTask('serve', ['open', 'connect:demo', 'watch']);
130+
grunt.registerTask('server', ['open', 'connect:demo', 'watch']);
131+
grunt.registerTask('dev', ['update-dist', 'server']);
131132
grunt.registerTask('build', ['clean', 'jshint', 'concat', 'ngtemplates', 'ngmin', 'cssmin', 'uglify']);
132133

133134
};

README.md

Lines changed: 48 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,69 @@
11
angular-multi-select-tree
22
=============================
33

4-
A native Angular multi select tree. No JQuery.
4+
Lightweight Angular multi select tree directive with arbitrary depth.
5+
6+
Size gzipped 3kb.
57

68
#### Demo Page:
79

8-
[Demo] (http://a5hik.github.io/angular-multi-select-tree)
10+
[Demo] (http://KristjanLiiva.github.io/angular-multi-select-tree)
911

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
1115

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+
```
1229

13-
##### Usage:
30+
#### Download:
1431

15-
```
16-
Make sure to load the scripts in your html.
32+
Download dist and include
1733
```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+
```
2137

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"
2241
```
2342

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+
```
2548

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+
}
2658
```
27-
angular.module('xyzApp', ['multi-select-tree', '....']);
59+
and require in your project
60+
```
61+
require('angular-multi-select-tree.css');
2862
```
2963

30-
###### Html Structure:
31-
32-
TBD
33-
Define your callbacks in the invoking controller.
64+
#### Development
65+
See package.json for available commands
3466

35-
##### License
67+
#### License
3668

3769
MIT, see [LICENSE.md](./LICENSE.md).

demo/index.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@
55
<title>AngularJS Demo UI Component</title>
66
<meta name="viewport" content="width=device-width">
77

8+
<!-- dependencies -->
89
<link rel="stylesheet" href="../node_modules/bootstrap/dist/css/bootstrap.css"/>
9-
<link rel="stylesheet" href="../dist/angular-multi-select-tree.css">
10-
1110
<script type="text/javascript" src="../node_modules/angular/angular.js"></script>
11+
12+
<!-- angular-multi-select-tree -->
1213
<script type="text/javascript" src="../dist/angular-multi-select-tree.js"></script>
14+
<link rel="stylesheet" href="../dist/angular-multi-select-tree.css">
15+
1316
</head>
1417

1518
<body ng-controller="demoAppCtrl">

0 commit comments

Comments
 (0)