Angular components go through a series of lifecycle stages from creation to destruction. Lifecycle hooks allow developers to tap into these stages and perform actions.
export class ExampleComponent implements OnInit, OnDestroy {
ngOnInit() {
console.log('Component Initialized');
}
ngOnDestroy() {
console.log('Component Destroyed');
}
}
Take quizzes related to this topic and see where you stand!
Start Quiz Now