Rendering and change detection
Learn Rendering and change detection (Module 17 · Advanced Angular, Angular) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
How does the screen stay in sync? Think of a whiteboard in a classroom. Change detection is the teacher walking the room to compare the whiteboard with the real data and rewriting whatever is different. The rendering architecture (Ivy) compiles each template ahead of time (AOT) into small instructions: a creation pass builds the DOM once and an update pass later refreshes only the bindings that changed. • Default change detection : after every trigger (click, timer, HTTP response) Angular checks every component from the root down. Simple and safe, but wasteful in big apps. • OnPush change...