Hydration and server vs browser code
Learn Hydration and server vs browser code (Module 19 · Server-Side Rendering and Modern Rendering, Angular) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
Waking up the server HTML With SSR the user first sees plain HTML. Hydration is the step where Angular attaches to that existing DOM and makes it interactive, instead of throwing it away and rendering again (which causes flicker and wasted work). Think of a pre-built shop front: hydration plugs in the electricity rather than rebuilding the shop. On the server there is no real browser : no window , no real document layout, no localStorage , no screen size. Code using them breaks with "window is not defined". These are browser-only APIs .