File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed
projects/igniteui-angular/src/lib/tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ export interface IgxTree {
23
23
expandAll ( nodes : IgxTreeNode < any > [ ] ) : void ;
24
24
collapseAll ( nodes : IgxTreeNode < any > [ ] ) : void ;
25
25
deselectAll ( node ?: IgxTreeNode < any > [ ] ) : void ;
26
- findNodes < T > ( searchTerm : any , comparer ?: IgxTreeSearchResolver ) : IgxTreeNode < any > [ ] | null ;
26
+ findNodes ( searchTerm : any , comparer ?: IgxTreeSearchResolver ) : IgxTreeNode < any > [ ] | null ;
27
27
}
28
28
29
29
// Item interfaces
@@ -34,7 +34,7 @@ export interface IgxTreeNode<T> {
34
34
selected : boolean | null ;
35
35
level : number ;
36
36
data : T ;
37
- children : IgxTreeNode < any > [ ] | null ;
37
+ children : QueryList < IgxTreeNode < any > > | null ;
38
38
selectedChange : EventEmitter < boolean > ;
39
39
}
40
40
Original file line number Diff line number Diff line change @@ -88,9 +88,11 @@ export class IgxTreeNodeComponent<T> extends ToggleAnimationPlayer implements Ig
88
88
@HostBinding ( 'class.igx-tree-node' )
89
89
public cssClass = 'igx-tree-node' ;
90
90
91
+ // TODO: Public API should expose array or null, not query list
91
92
@ContentChildren ( IGX_TREE_NODE_COMPONENT , { read : IGX_TREE_NODE_COMPONENT } )
92
- private _children : QueryList < IgxTreeNode < any > > ;
93
+ public children : QueryList < IgxTreeNode < any > > ;
93
94
95
+ // TODO: Expose in public API instead of `children` query list
94
96
/**
95
97
* Return the child nodes of the node (if any)
96
98
*
@@ -102,8 +104,8 @@ export class IgxTreeNodeComponent<T> extends ToggleAnimationPlayer implements Ig
102
104
* const children: IgxTreeNode<any>[] = node.children;
103
105
* ```
104
106
*/
105
- public get children ( ) : IgxTreeNode < any > [ ] {
106
- return this . _children ?. length ? this . _children . toArray ( ) : null ;
107
+ public get _children ( ) : IgxTreeNode < any > [ ] {
108
+ return this . children ?. length ? this . children . toArray ( ) : null ;
107
109
}
108
110
109
111
@ViewChild ( 'defaultSelect' , { read : TemplateRef , static : true } )
Original file line number Diff line number Diff line change @@ -251,7 +251,7 @@ export class IgxTreeSelectionService {
251
251
* Handle the selection state of a given node based the selection states of its direct children
252
252
*/
253
253
private handleNodeSelectionState ( node : IgxTreeNode < any > ) {
254
- const nodesArray = ( node && node . children ) ? node . children : [ ] ;
254
+ const nodesArray = ( node && node . children ) ? node . children . toArray ( ) : [ ] ;
255
255
if ( nodesArray . length ) {
256
256
if ( nodesArray . every ( n => this . nodesToBeSelected . has ( n ) ) ) {
257
257
this . nodesToBeSelected . add ( node ) ;
You can’t perform that action at this time.
0 commit comments