Skip to content

Commit 70783d5

Browse files
committed
docs: reset scroll value
1 parent 75dd70c commit 70783d5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

apps/kitchen-sink/src/app/soba/camera-scroll/camera-scroll.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ChangeDetectionStrategy, Component, ElementRef, inject, InjectionToken } from '@angular/core';
1+
import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, inject, InjectionToken } from '@angular/core';
22
import { NgtCanvas } from 'angular-three';
33
import { Experience } from './experience';
44
import { Overlay } from './overlay';
@@ -33,4 +33,11 @@ export const SCROLL = new InjectionToken('scroll', {
3333
export default class CameraScroll {
3434
protected sceneGraph = Experience;
3535
protected host = inject<ElementRef<HTMLElement>>(ElementRef);
36+
37+
constructor() {
38+
const scroll = inject(SCROLL);
39+
inject(DestroyRef).onDestroy(() => {
40+
scroll.value = 0;
41+
});
42+
}
3643
}

0 commit comments

Comments
 (0)