File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -72,18 +72,19 @@ export class CdkNestedTreeNode<T, K = T>
72
72
const childrenAccessor = this . _tree . _getChildrenAccessor ( ) ;
73
73
if ( ! childrenAccessor && ( typeof ngDevMode === 'undefined' || ngDevMode ) ) {
74
74
throw getTreeControlFunctionsMissingError ( ) ;
75
- }
76
- const childrenNodes = childrenAccessor ?.( this . data ) ;
77
- if ( Array . isArray ( childrenNodes ) ) {
78
- this . updateChildrenNodes ( childrenNodes as T [ ] ) ;
79
- } else if ( isObservable ( childrenNodes ) ) {
80
- childrenNodes
75
+ } else if ( childrenAccessor ) {
76
+ const childrenNodes = childrenAccessor ( this . data ) ;
77
+ if ( Array . isArray ( childrenNodes ) ) {
78
+ this . updateChildrenNodes ( childrenNodes as T [ ] ) ;
79
+ } else if ( isObservable ( childrenNodes ) ) {
80
+ childrenNodes
81
+ . pipe ( takeUntil ( this . _destroyed ) )
82
+ . subscribe ( result => this . updateChildrenNodes ( result ) ) ;
83
+ }
84
+ this . nodeOutlet . changes
81
85
. pipe ( takeUntil ( this . _destroyed ) )
82
- . subscribe ( result => this . updateChildrenNodes ( result ) ) ;
86
+ . subscribe ( ( ) => this . updateChildrenNodes ( ) ) ;
83
87
}
84
- this . nodeOutlet . changes
85
- . pipe ( takeUntil ( this . _destroyed ) )
86
- . subscribe ( ( ) => this . updateChildrenNodes ( ) ) ;
87
88
}
88
89
89
90
// This is a workaround for https://github.com/angular/angular/issues/23091
You can’t perform that action at this time.
0 commit comments