11. Angular Component Lifecycle

Опубликовано: 12 Март 2025
на канале: Ervis Trupja
5,892
78

Lifecycle hooks are a special functionality in Angular that allow us to “hook into” and run code at a specific lifecycle event of a component or directive.
As a developer, you can tap into key moments in that lifecycle by implementing one or more of the "Lifecycle Hook" interfaces, all of them available in the "@angular/core" library.
Each interface defines a single hook method, whose name is the interface name prefixed with ng (ngInterfaceName).

Ex: For OnInit interface, the hook method would be 𝘯𝘨OnInit.
-----------------------------
📍 Source code: https://github.com/etrupja/angular-mo...
-----------------------------
📣 Blog: https://dotnethow.net
📣 Udemy: https://www.udemy.com/user/ervis-trupja/
📣 Pluralsight: https://www.pluralsight.com/authors/e...
📣 LinkedIn:   / ervis-trupja  
-----------------------------

#angular #angularcomponents #lifecyclehooks