bindPipeDestroyLifecycleCallbacks function
void
bindPipeDestroyLifecycleCallbacks(
- CompilePipeMetadata pipeMeta,
- Expression pipeInstance,
- CompileView view
Call ngOnDestroy for each pipe that implements OnDestroy
.
Implementation
void bindPipeDestroyLifecycleCallbacks(
CompilePipeMetadata pipeMeta,
o.Expression pipeInstance,
CompileView view,
) {
if (pipeMeta.lifecycleHooks.contains(LifecycleHooks.onDestroy)) {
view.destroyMethod.addStmt(pipeInstance.callMethod(
Lifecycles.onDestroy,
[],
).toStmt());
}
}