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>
7272 const childrenAccessor = this . _tree . _getChildrenAccessor ( ) ;
7373 if ( ! childrenAccessor && ( typeof ngDevMode === 'undefined' || ngDevMode ) ) {
7474 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
8185 . pipe ( takeUntil ( this . _destroyed ) )
82- . subscribe ( result => this . updateChildrenNodes ( result ) ) ;
86+ . subscribe ( ( ) => this . updateChildrenNodes ( ) ) ;
8387 }
84- this . nodeOutlet . changes
85- . pipe ( takeUntil ( this . _destroyed ) )
86- . subscribe ( ( ) => this . updateChildrenNodes ( ) ) ;
8788 }
8889
8990 // This is a workaround for https://github.com/angular/angular/issues/23091
You can’t perform that action at this time.
0 commit comments