Angular 21.2: What's new
Angular 21.2.0 introduces TypeScript 6 support, exhaustive @switch checks, instanceof in templates, massive signal forms improvements, nested animations and a bunch of DX improvements.
1. @angular/animations
2. @angular/build
a) Headless Option for Unit-Test Builder - PR
The unit-test builder now supports a headless option for browser-based tests. You can toggle between headless and headed mode without modifying your Vitest configuration.
ng test --headless=false # Run with visible browser for debugging
ng test # Default: headlessb) Vitest Browser with Playwright OS Theme - PR
When running Vitest browser tests with Playwright, the browser now respects your operating system’s theme (light/dark mode). This means your tests run in an environment that matches your system preferences, which can be relevant for testing theme-dependent UI behavior.
3. @angular/common
a) Outlet Injector Option for ngTemplateOutlet - PR
To understand this feature, you first need to understand a quirk of how ngTemplateOutlet works with Angular’s dependency injection.
The problem: templates resolve services from where they’re defined, not where they’re rendered.
Imagine you define an <ng-template> at the root of your component. Inside that template, you try to inject() a service. Angular will look for that service starting from the definition site of the template (where the <ng-template> tag lives in the source code), not from where the template is actually stamped into the DOM via *ngTemplateOutlet.
Here’s a concrete example to make this tangible:



