Skip to content

Commit 72ac6e8

Browse files
committed
Merge branch 'master' of github.com:500tech/angular-tree-component
2 parents 64ed304 + 4a75027 commit 72ac6e8

File tree

6 files changed

+23
-6
lines changed

6 files changed

+23
-6
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ git clone https://github.com/500tech/angular-tree-component
4848
4949
cd angular-tree-component/example/cli
5050
npm install
51-
npm install -g angular-cli
52-
ng serve
51+
./node_modules/.bin/ng serve
5352
```
5453

5554
## SystemJS

doc/index.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@ <h2 id="example">Example</h2>
105105

106106
<span class="hljs-keyword">cd</span> angular-tree-component/example/<span class="hljs-keyword">cli</span>
107107
npm install
108-
npm install -<span class="hljs-keyword">g</span> angular-<span class="hljs-keyword">cli</span>
109-
ng serve
108+
./node_modules/.bin/ng serve
110109
</code></pre><h2 id="systemjs">SystemJS</h2>
111110
<p>Sorry guys, SystemJS is not supported.
112111
Modern web applications use bundlers like Webpack.</p>

lib/defs/api.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,10 @@ export interface ITreeOptions {
231231
* This include direction, expander style, and change key binding (right key collapse and left key expands instead of vice-versa)
232232
*/
233233
rtl?: boolean;
234+
/**
235+
* Specifies id of root node (virtualRoot)
236+
*/
237+
rootId?: any;
234238
}
235239

236240
export interface ITreeNode {

lib/models/tree-options.model.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ export class TreeOptions {
8282
get animateAcceleration(): number { return this.options.animateAcceleration || 1.2; }
8383
get scrollOnSelect(): boolean { return this.options.scrollOnSelect === undefined ? true : this.options.scrollOnSelect; }
8484
get rtl(): boolean { return !!this.options.rtl; }
85+
get rootId(): any {return this.options.rootId; }
8586
actionMapping: IActionMapping;
8687

8788
constructor(private options: ITreeOptions = {}) {

lib/models/tree.model.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ export class TreeModel implements ITreeModel {
170170
@action update() {
171171
// Rebuild tree:
172172
let virtualRootConfig = {
173+
id: this.options.rootId,
173174
virtual: true,
174175
[this.options.childrenField]: this.nodes
175176
};

rollup.config.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,19 @@ export default {
1313
sourceMap: true,
1414
external: [
1515
'@angular/core',
16-
'@angular/common'
17-
]
16+
'@angular/common',
17+
'lodash',
18+
'mobx',
19+
'mobx-angular'
20+
],
21+
onwarn: function (warning) {
22+
// ignore spurious warnings about TS generated code such as __decorate, etc.
23+
if (warning.code === 'THIS_IS_UNDEFINED' || warning.message.indexOf("The 'this' keyword is equivalent to 'undefined'") > -1) {
24+
return;
25+
}
26+
27+
// console.warn everything else
28+
console.warn( warning.message );
29+
}
30+
1831
};

0 commit comments

Comments
 (0)