Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 2 additions & 15 deletions goldens/material/tree/index.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

```ts

import { AfterContentInit } from '@angular/core';
import { CdkNestedTreeNode } from '@angular/cdk/tree';
import { CdkTree } from '@angular/cdk/tree';
import { CdkTreeNode } from '@angular/cdk/tree';
Expand All @@ -19,13 +18,11 @@ import * as i0 from '@angular/core';
import * as i1 from '@angular/cdk/tree';
import * as i2 from '@angular/cdk/bidi';
import { Observable } from 'rxjs';
import { OnDestroy } from '@angular/core';
import { OnInit } from '@angular/core';
import { TreeControl } from '@angular/cdk/tree';
import { ViewContainerRef } from '@angular/core';

// @public
export class MatNestedTreeNode<T, K = T> extends CdkNestedTreeNode<T, K> implements AfterContentInit, OnDestroy, OnInit {
export class MatNestedTreeNode<T, K = T> extends CdkNestedTreeNode<T, K> {
// @deprecated
get disabled(): boolean;
set disabled(value: boolean);
Expand All @@ -34,12 +31,6 @@ export class MatNestedTreeNode<T, K = T> extends CdkNestedTreeNode<T, K> impleme
// (undocumented)
static ngAcceptInputType_tabIndex: unknown;
// (undocumented)
ngAfterContentInit(): void;
// (undocumented)
ngOnDestroy(): void;
// (undocumented)
ngOnInit(): void;
// (undocumented)
node: T;
get tabIndex(): number;
set tabIndex(value: number);
Expand Down Expand Up @@ -111,7 +102,7 @@ export class MatTreeNestedDataSource<T> extends DataSource<T> {
}

// @public
export class MatTreeNode<T, K = T> extends CdkTreeNode<T, K> implements OnInit, OnDestroy {
export class MatTreeNode<T, K = T> extends CdkTreeNode<T, K> {
constructor();
// @deprecated
defaultTabIndex: number;
Expand All @@ -124,10 +115,6 @@ export class MatTreeNode<T, K = T> extends CdkTreeNode<T, K> implements OnInit,
static ngAcceptInputType_disabled: unknown;
// (undocumented)
static ngAcceptInputType_tabIndexInputBinding: unknown;
// (undocumented)
ngOnDestroy(): void;
// (undocumented)
ngOnInit(): void;
// @deprecated
get tabIndexInputBinding(): number;
set tabIndexInputBinding(value: number);
Expand Down
35 changes: 2 additions & 33 deletions src/material/tree/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,8 @@ import {
CdkTreeNodeDef,
} from '@angular/cdk/tree';
import {
AfterContentInit,
Directive,
Input,
OnDestroy,
OnInit,
booleanAttribute,
numberAttribute,
inject,
Expand Down Expand Up @@ -52,7 +49,7 @@ function isNoopTreeKeyManager<T extends TreeKeyManagerItem>(
'[tabindex]': '_getTabindexAttribute()',
},
})
export class MatTreeNode<T, K = T> extends CdkTreeNode<T, K> implements OnInit, OnDestroy {
export class MatTreeNode<T, K = T> extends CdkTreeNode<T, K> {
/**
* The tabindex of the tree node.
*
Expand Down Expand Up @@ -111,16 +108,6 @@ export class MatTreeNode<T, K = T> extends CdkTreeNode<T, K> implements OnInit,
const tabIndex = inject(new HostAttributeToken('tabindex'), {optional: true});
this.tabIndexInputBinding = Number(tabIndex) || this.defaultTabIndex;
}

// This is a workaround for https://github.com/angular/angular/issues/23091
// In aot mode, the lifecycle hooks from parent class are not called.
override ngOnInit() {
super.ngOnInit();
}

override ngOnDestroy() {
super.ngOnDestroy();
}
}

/**
Expand Down Expand Up @@ -152,10 +139,7 @@ export class MatTreeNodeDef<T> extends CdkTreeNodeDef<T> {
'class': 'mat-nested-tree-node',
},
})
export class MatNestedTreeNode<T, K = T>
extends CdkNestedTreeNode<T, K>
implements AfterContentInit, OnDestroy, OnInit
{
export class MatNestedTreeNode<T, K = T> extends CdkNestedTreeNode<T, K> {
@Input('matNestedTreeNode') node!: T;

/**
Expand Down Expand Up @@ -184,19 +168,4 @@ export class MatNestedTreeNode<T, K = T>
this._tabIndex = value;
}
private _tabIndex!: number;

// This is a workaround for https://github.com/angular/angular/issues/19145
// In aot mode, the lifecycle hooks from parent class are not called.
// TODO(tinayuangao): Remove when the angular issue #19145 is fixed
override ngOnInit() {
super.ngOnInit();
}

override ngAfterContentInit() {
super.ngAfterContentInit();
}

override ngOnDestroy() {
super.ngOnDestroy();
}
}
Loading