Loading topic
ngOnChanges, the hook Angular calls when a bound input changes. It also covers the SimpleChanges object that describes each change.4 min readngOnInit. Here you will learn exactly when ngOnInit runs, what it is good for, and where it stops being the right tool.4 min read@Input bindings. Here you will learn what actually causes Angular to call the hooks, and why a hook sometimes does not run when you expect it to.5 min read@Input() bindings work, how ngOnChanges and ngOnInit behave, and the basics of change detection from the previous chapters. You should also be comfortable with TypeScript classes and with the difference between a reference and a value.4 min readngOnInit and ngOnChanges, and can use <ng-content> for basic content projection. You should also be comfortable reading RxJS observables. The chapter covers ngAfterContentInit and ngAfterContentChecked, the two hooks that tell a component its 4 min readngOnInit and ngOnChanges behave, and you have a basic idea of how change detection runs. Here you will learn when ngAfterViewInit and ngAfterViewChecked run, what is safe to do in them, and why they are a common 4 min readconstructor, ngOnChanges and ngOnInit, and you can create and unsubscribe an RxJS subscription. The chapter explains what ngOnDestroy is, which resources need cleanup, and where cleanup code goes wrong.5 min readngOnInit and ngOnDestroy work, and how to subscribe to an RxJS observable. You should also know what the inject() function does. The previous chapter showed the classic pattern of storing a Subscription and unsubs5 min readngOnChanges, ngOnInit, ngDoCheck, the content and view hooks, ngOnDestroy) and the single-component order from the previous chapter. Here you will see how those sequences combine when one component sits inside another. This is where most "w4 min readngOnInit, ngAfterViewInit, ngOnDestroy), basic change detection, and Angular signals at the level of signal() and .set(). It uses the Angular 19+ API. Version differences are noted where they matter.4 min readngOnChanges, ngOnInit, the view hooks, ngOnDestroy and DestroyRef. It also assumes you have seen signals (signal, computed) at a basic level. Here you will see how signal-based APIs replace some hooks, coexist with others5 min readafterNextRender and signal queries a4 min readdescribe, it, expect) and know the hook order from the earlier chapters. The examples use only matchers that exist in both frameworks. Here you will drive lifecycle hooks from tests, using TestBed and ComponentFixture.4 min read