---
source: https://iinventedlight.com/library/notes/angular-lifecycle-hooks.md
title: "Angular lifecycle hooks run during create, check, and destroy"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "CC BY 4.0 (Angular docs, footer-verified); MIT (angular/angular source); prose restates cited source lines in own words"
license_family: angular-docs-ccby
attribution: "Summary by iinventedlight (AI-assisted). Sources: Angular docs, CC BY 4.0 text (angular/angular adev footer); Angular source, MIT (angular/angular). Notices: Angular documentation (angular/angular adev): Copyright (c) 2010-2026 Google LLC; CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Angular source (angular/angular): Copyright (c) 2010-2026 Google LLC; MIT (https://raw.githubusercontent.com/angular/angular/main/LICENSE)."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-11
status: published
approved_by: "Cole Withington, 2026-11-11 09:59 PT, Librarian chat widget t34s5: \"Yes, publish all 25 Angular and Vite drafts\""
checked_on: 2026-11-11
as_of: 2026-11-11
confidence: medium
untested: "No project was run for this note; only the fetched documentation and source files were read."
category: coding-references
topic_area: "code-web: Angular lifecycle hooks"
tags: [angular, lifecycle, hooks, components]
client: Librarian
sources:
  - id: S1
    title: "Component lifecycle hooks"
    publisher: Angular docs
    url: https://angular.dev/guide/components/lifecycle
    accessed: 2026-11-11
    license: "CC BY 4.0"
  - id: S2
    title: "Lifecycle hook callbacks"
    publisher: Angular source
    url: https://github.com/angular/angular/blob/main/packages/core/src/render3/hooks.ts
    accessed: 2026-11-11
    license: "MIT"
---
# Lifecycle hooks run code as Angular creates, checks, and destroys a component

**Answer:** A component's lifecycle is the sequence of steps between its creation and its destruction. Each step is part of how Angular renders components and checks them for updates. You can implement lifecycle hooks to run code during those steps.

Hooks that belong to one component instance are methods on the component class. Hooks that belong to the application as a whole are functions that accept a callback. The constructor is the ordinary JavaScript class constructor and runs when Angular instantiates the component.

Angular walks the application tree from top to bottom, checking template bindings. Lifecycle hooks run during that traversal. The traversal visits each component once, so you should avoid further state changes in the middle of the process.

## In source

Init hooks such as `ngOnInit`, `ngAfterContentInit`, and `ngAfterViewInit` must all run once and only once, across many change detection cycles. That remains true even if some hooks throw.

## See also

- [angular-components](https://iinventedlight.com/library/notes/angular-components/)
- [angular-signals](https://iinventedlight.com/library/notes/angular-signals/)

## Claims

- id: C1
  claim: A component lifecycle is the sequence from creation to destruction.
  source: S1
  evidence: "A component's **lifecycle** is the sequence of steps that happen between the component's creation"

- id: C2
  claim: You implement lifecycle hooks to run code during those steps.
  source: S1
  evidence: "you can implement **lifecycle hooks** to run code during these steps."

- id: C3
  claim: Init hooks must execute once and only once.
  source: S2
  evidence: "Init hooks (ngOnInit, ngAfterContentInit, ngAfterViewInit) must all be executed once and only"

## Sources

- [S1] Component lifecycle hooks. Angular docs. https://angular.dev/guide/components/lifecycle . License: CC BY 4.0. Accessed 2026-11-11.

- [S2] Lifecycle hook callbacks. Angular source. https://github.com/angular/angular/blob/main/packages/core/src/render3/hooks.ts . License: MIT. Accessed 2026-11-11.


License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources and notices: Angular documentation (angular/angular adev): Copyright (c) 2010-2026 Google LLC; CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Angular source (angular/angular): Copyright (c) 2010-2026 Google LLC; MIT (https://raw.githubusercontent.com/angular/angular/main/LICENSE). Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
