Skip to content
This repository was archived by the owner on Nov 20, 2018. It is now read-only.

Commit 21e66da

Browse files
committed
Update README
1 parent f9264e1 commit 21e66da

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ In component where you create tree, you should register _tree store_, create _Tr
6969
disableMoveNodes: false,
7070
treeId: 'tree3',
7171
dragZone: 'tree3',
72-
dropZone: ['tree3']
72+
dropZone: ['tree3'],
73+
isAnimation: true // add animation to action "expand" and "collapse"
7374
};
7475

7576
public treeModel: TreeModel;
@@ -140,8 +141,10 @@ and _newItem.component.html_
140141
</span>
141142
</div>
142143
</div>
143-
<div class="tree" *ngIf="isExpanded">
144-
<new-tree-item *ngFor="let child of children$ | async" [node]="child" [treeModel]="treeModel" [contextMenu]="contextMenu"></new-tree-item>
144+
<div class="tree" [@isExpanded]="animationState" (@isExpanded.done)="onAnimationDone($event)">
145+
<div *ngIf="isExpanded">
146+
<new-tree-item *ngFor="let child of children$ | async" [node]="child" [treeModel]="treeModel" [contextMenu]="contextMenu"></new-tree-item>
147+
</div>
145148
</div>
146149

147150

@@ -226,6 +229,7 @@ At the end do not forget to add this effects to your app.
226229
* add translation module
227230
* drop elements on tree nodes
228231
* update and lock of some npm package versions
232+
* add possibility to animate action _collapse_ and _expand_ nodes of tree, using in configuration property _isAnimation: true_
229233

230234
### v2.0.1
231235
* add [MIT LICENSE](https://github.com/qjon/angular2-tree/blob/master/LICENSE)
@@ -277,11 +281,6 @@ At the end do not forget to add this effects to your app.
277281
* primary version with all features described below.
278282

279283

280-
## Demo
281-
282-
Working demo with _local storage_ you can find [here](https://qjon.github.io/angular2-tree/).
283-
284-
285284
## Demo
286285

287286
Working demo with _local storage_ you can find [here](https://qjon.github.io/angular2-tree/).

src/tree.component.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22
<button *ngIf="treeModel.configuration.showAddButton" class="btn btn-default" (click)="onAdd()">
33
<i class="fa fa-plus"></i> {{'RI_TREE_LBL_ADD_NODE' | translate}}
44
</button>
5-
<div #customTemplate><!-- no space -->
6-
<ng-content></ng-content><!-- no space --></div>
7-
<div *ngIf="customTemplate.childNodes.length === 0">
8-
<rign-tree-item *ngFor="let node of treeModel.getRootNodes() | async" [node]="node" [treeModel]="treeModel"
5+
<div #customTemplate><!-- no space --><ng-content></ng-content><!-- no space --></div>
6+
<div *ngIf="customTemplate.childNodes.length === 0"><rign-tree-item *ngFor="let node of treeModel.getRootNodes() | async" [node]="node" [treeModel]="treeModel"
97
[contextMenu]="contextMenu"></rign-tree-item>
108
</div>
119
<ri-dropzone [treeModel]="treeModel"></ri-dropzone>

0 commit comments

Comments
 (0)