We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0875b51 commit ab35596Copy full SHA for ab35596
1 file changed
aio/content/guide/lifecycle-hooks.md
@@ -110,13 +110,13 @@ Register a callback with the `DestroyRef`:
110
class Counter {
111
count = 0;
112
constructor() {
113
- // Start a timer to increment the counter every second.
114
- const id = setInterval(() => this.count++, 1000);
+ // Start a timer to increment the counter every second.
+ const id = setInterval(() => this.count++, 1000);
115
116
- // Stop the timer when the component is destroyed.
117
- const destroyRef = inject(DestroyRef);
118
- destroyRef.onDestroy(() => clearInterval(id));
119
- }
+ // Stop the timer when the component is destroyed.
+ const destroyRef = inject(DestroyRef);
+ destroyRef.onDestroy(() => clearInterval(id));
+ }
120
}
121
```
122
0 commit comments