fix(ivy): ngOnDestroy hooks should be called on providers (#27955)
PR Close #27955
This commit is contained in:

committed by
Kara Erickson

parent
996435b79a
commit
e775313188
@ -503,6 +503,10 @@ export function getNodeInjectable(
|
||||
setTNodeAndViewData(tNode, lData);
|
||||
try {
|
||||
value = lData[index] = factory.factory(null, tData, lData, tNode);
|
||||
const tView = lData[TVIEW];
|
||||
if (value && factory.isProvider && value.ngOnDestroy) {
|
||||
(tView.destroyHooks || (tView.destroyHooks = [])).push(index, value.ngOnDestroy);
|
||||
}
|
||||
} finally {
|
||||
if (factory.injectImpl) setInjectImplementation(previousInjectImplementation);
|
||||
setIncludeViewProviders(previousIncludeViewProviders);
|
||||
|
Reference in New Issue
Block a user