Lifecycle Hook

noun

say it: “LYFE-sy-kul HUK” /ˈlaɪfsaɪkəl hʊk/

A method Angular calls at key moments in a component's life, such as when it starts or is removed.

What is Lifecycle Hook?

A lifecycle hook is a method Angular calls at a certain moment in a component's life: when it starts (ngOnInit), when inputs change (ngOnChanges), when it is removed (ngOnDestroy).

In a sentence

  • “ngOnInit is the lifecycle hook where we load the products.”

Level: Apprentice · More Angular terms at this level

Updated