Skip to content

Commit ab35596

Browse files
cadedupontalxhub
authored andcommitted
docs: fix indentation issue in component lifecycle (#50490)
PR Close #50490
1 parent 0875b51 commit ab35596

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

aio/content/guide/lifecycle-hooks.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,13 @@ Register a callback with the `DestroyRef`:
110110
class Counter {
111111
count = 0;
112112
constructor() {
113-
// Start a timer to increment the counter every second.
114-
const id = setInterval(() => this.count++, 1000);
113+
// Start a timer to increment the counter every second.
114+
const id = setInterval(() => this.count++, 1000);
115115

116-
// Stop the timer when the component is destroyed.
117-
const destroyRef = inject(DestroyRef);
118-
destroyRef.onDestroy(() => clearInterval(id));
119-
}
116+
// Stop the timer when the component is destroyed.
117+
const destroyRef = inject(DestroyRef);
118+
destroyRef.onDestroy(() => clearInterval(id));
119+
}
120120
}
121121
```
122122

0 commit comments

Comments
 (0)