File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
projects/igniteui-angular/src/lib/tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed 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: Refactor `children` to get `this.children.toArray() || null`
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