Skip to content

Commit 8f4fe41

Browse files
committed
change isExpanded setter to private method
1 parent b14dec0 commit 8f4fe41

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/cdk/tree/tree.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ export class CdkTreeNode<T> implements DoCheck, FocusableOption, OnDestroy, OnIn
346346
return this._tree.treeControl.isExpanded(this._data);
347347
}
348348

349-
set isExpanded(_expanded: boolean) {
349+
private _setExpanded(_expanded: boolean) {
350350
this._expanded = _expanded;
351351
this._elementRef.nativeElement.setAttribute('aria-expanded', `${_expanded}`);
352352
}
@@ -370,7 +370,7 @@ export class CdkTreeNode<T> implements DoCheck, FocusableOption, OnDestroy, OnIn
370370
// TODO: move to host after View Engine deprecation
371371
this._elementRef.nativeElement.classList.add('cdk-tree-node');
372372
this.role = 'treeitem';
373-
this.isExpanded = this.isExpanded;
373+
this._setExpanded(this.isExpanded);
374374
}
375375

376376
ngOnInit(): void {
@@ -384,7 +384,7 @@ export class CdkTreeNode<T> implements DoCheck, FocusableOption, OnDestroy, OnIn
384384
// It is not set using a @HostBinding because they sometimes get lost with Mixin based classes.
385385
// TODO: move to host after View Engine deprecation
386386
if (this.isExpanded != this._expanded) {
387-
this.isExpanded = this.isExpanded;
387+
this._setExpanded(this.isExpanded);
388388
}
389389
}
390390

tools/public_api_guard/cdk/tree.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ export declare class CdkTreeNode<T> implements DoCheck, FocusableOption, OnDestr
7474
get data(): T;
7575
set data(value: T);
7676
get isExpanded(): boolean;
77-
set isExpanded(_expanded: boolean);
7877
get level(): number;
7978
get role(): 'treeitem' | 'group';
8079
set role(_role: 'treeitem' | 'group');

0 commit comments

Comments
 (0)