diff --git a/packages/core/src/render3/interfaces/view.ts b/packages/core/src/render3/interfaces/view.ts index 1ca2b06b35..9383153210 100644 --- a/packages/core/src/render3/interfaces/view.ts +++ b/packages/core/src/render3/interfaces/view.ts @@ -539,11 +539,6 @@ export interface TView { * `useCaptureOrIndx >= 0` `removeListener = LView[CLEANUP][useCaptureOrIndx]` * `useCaptureOrIndx < 0` `subscription = LView[CLEANUP][-useCaptureOrIndx]` * - * If it's a renderer2 style listener or ViewRef destroy hook being stored: - * 1st index is: index of the cleanup function in LView.cleanupInstances[] - * 2nd index is: `null` - * `lView[CLEANUP][tView.cleanup[i+0]]()` - * * If it's an output subscription or query list destroy hook: * 1st index is: output unsubscribe function / query list destroy function * 2nd index is: index of function context in LView.cleanupInstances[] diff --git a/packages/core/src/render3/node_manipulation.ts b/packages/core/src/render3/node_manipulation.ts index 14ad1e7541..cfc42d8b43 100644 --- a/packages/core/src/render3/node_manipulation.ts +++ b/packages/core/src/render3/node_manipulation.ts @@ -488,7 +488,7 @@ function removeListeners(lView: LView): void { const lCleanup = lView[CLEANUP] !; for (let i = 0; i < tCleanup.length - 1; i += 2) { if (typeof tCleanup[i] === 'string') { - // This is a listener with the native renderer + // This is a native DOM listener const idxOrTargetGetter = tCleanup[i + 1]; const target = typeof idxOrTargetGetter === 'function' ? idxOrTargetGetter(lView) : @@ -496,7 +496,7 @@ function removeListeners(lView: LView): void { const listener = lCleanup[tCleanup[i + 2]]; const useCaptureOrSubIdx = tCleanup[i + 3]; if (typeof useCaptureOrSubIdx === 'boolean') { - // DOM listener + // native DOM listener registered with Renderer3 target.removeEventListener(tCleanup[i], listener, useCaptureOrSubIdx); } else { if (useCaptureOrSubIdx >= 0) { @@ -508,10 +508,6 @@ function removeListeners(lView: LView): void { } } i += 2; - } else if (typeof tCleanup[i] === 'number') { - // This is a listener with renderer2 (cleanup fn can be found by index) - const cleanupFn = lCleanup[tCleanup[i]]; - cleanupFn(); } else { // This is a cleanup function that is grouped with the index of its context const context = lCleanup[tCleanup[i + 1]];