diff --git a/adev/src/app/app-scroller.ts b/adev/src/app/app-scroller.ts index 9346b19b5488f..b70bbcb0694a1 100644 --- a/adev/src/app/app-scroller.ts +++ b/adev/src/app/app-scroller.ts @@ -64,7 +64,7 @@ export class AppScroller { const {anchor, position} = this._lastScrollEvent; // Don't scroll during rendering - this.cancelScroll = afterNextRender( + const ref = afterNextRender( { write: () => { if (position) { @@ -77,6 +77,9 @@ export class AppScroller { }, }, {injector: this.injector}, - ).destroy; + ); + this.cancelScroll = () => { + ref.destroy(); + }; } }