I'm submitting a...
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x ] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior
In material tree, the MatTreeNestedNode extends a mixin of CdkTreeNestedNode. CdkTreeNestedNode has ngAfterContentInit and ngOnDestroy https://github.com/angular/material2/blob/master/src/lib/tree/node.ts#L89
But the ngAfterContentInit and ngOnDestroy functions are not called in MatTreeNestedNode.
https://github.com/angular/material2/blob/master/src/cdk/tree/nested-node.ts#L71
This only happen in aot mode (in new angular-cli, the --prod mode)
We have the issue in material: angular/components#10437
Expected behavior
The lifecycle hooks in MatTreeNestedNode should be called when it extends from CdkTreeNestedNode.
Minimal reproduction of the problem with instructions
Same reproduction in angular/components#10437
git clone https://github.com/DocLM/nested-tree-example
npm i -g @angular/[email protected]
Then run
ng serve --prod <--- This case the nested nodes are not expandable, because the lifecycle hooks are not called
ng serve <-- This case the nested nodes are expandable and working properly
What is the motivation / use case for changing the behavior?
Environment
Angular version: X.Y.Z
Browser:
- [x ] Chrome (desktop) version 64.0.3282.186
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
For Tooling issues:
- Node version: v8.9.4
- Platform: Linux
Others:
I'm submitting a...
Current behavior
In material tree, the
MatTreeNestedNodeextends a mixin ofCdkTreeNestedNode.CdkTreeNestedNodehasngAfterContentInitandngOnDestroyhttps://github.com/angular/material2/blob/master/src/lib/tree/node.ts#L89But the
ngAfterContentInitandngOnDestroyfunctions are not called inMatTreeNestedNode.https://github.com/angular/material2/blob/master/src/cdk/tree/nested-node.ts#L71
This only happen in aot mode (in new angular-cli, the
--prodmode)We have the issue in material: angular/components#10437
Expected behavior
The lifecycle hooks in
MatTreeNestedNodeshould be called when it extends fromCdkTreeNestedNode.Minimal reproduction of the problem with instructions
Same reproduction in angular/components#10437
git clone https://github.com/DocLM/nested-tree-examplenpm i -g @angular/[email protected]Then run
ng serve --prod<--- This case the nested nodes are not expandable, because the lifecycle hooks are not calledng serve<-- This case the nested nodes are expandable and working properlyWhat is the motivation / use case for changing the behavior?
Environment