Skip to content

refactor(material/tree): remove lifecycle hook workarounds - #33890

Open
MeAkib wants to merge 1 commit into
angular:mainfrom
MeAkib:refactor/tree-remove-lifecycle-workaround
Open

MeAkib wants to merge 1 commit into
angular:mainfrom
MeAkib:refactor/tree-remove-lifecycle-workaround

Conversation

@MeAkib

@MeAkib MeAkib commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

MatTreeNode and MatNestedTreeNode were overriding ngOnInit, ngAfterContentInit and ngOnDestroy only to call super. This was a workaround for angular/angular#19145 and angular/angular#23091 where the ViewEngine AOT compiler didn't call lifecycle hooks inherited from a parent class. Ivy calls inherited hooks so the overrides aren't necessary anymore.

The public API is unchanged since the methods are still inherited from CdkTreeNode and CdkNestedTreeNode.

`MatTreeNode` and `MatNestedTreeNode` were overriding `ngOnInit`, `ngAfterContentInit` and `ngOnDestroy` only to call `super`. This was a workaround for angular/angular#19145 and angular/angular#23091 where the ViewEngine AOT compiler didn't call lifecycle hooks inherited from a parent class. Ivy calls inherited hooks so the overrides aren't necessary anymore.

The public API is unchanged since the methods are still inherited from `CdkTreeNode` and `CdkNestedTreeNode`.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant