Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Angular Knowledge Patch?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/nevaberry-angular-knowledge-patch-nevaberry-plugins)
---
name: angular-knowledge-patch
description: Angular
version: "22.3.0"
license: MIT
metadata:
author: Nevaberry
---
# Angular Knowledge Patch
Load this skill when upgrading or maintaining Angular applications, diagnosing
changed behavior, or working with signals, forms, rendering, routing, and tooling.
Use the quick reference for common decisions and the topic files for detailed
conditions, examples, and version-specific behavior.
## Reference index
| Reference | Topics |
| --- | --- |
| [Compatibility, security, and releases](references/compatibility-security-and-releases.md) | Runtime and compiler requirements, browser support, upgrade policy, sanitization, HTTP behavior |
| [Core reactivity](references/core-reactivity.md) | Change detection, zoneless rendering, effects, signals, resources, dynamic components, injection |
| [Signal Forms](references/signal-forms.md) | Field bindings, schemas, validation, submission, pending edits, classic form compatibility |
| [SSR, hydration, and routing](references/ssr-hydration-and-routing.md) | Server routes, request state, transfer cache, hydration, navigation, redirects, route resources |
| [Templates and animations](references/templates-and-animations.md) | Expressions, control flow, deferred content, diagnostics, error boundaries, animations, styles |
| [Testing and tooling](references/testing-and-tooling.md) | Test runners, migrations, component and HTTP tests, CLI builds, MCP, WebMCP |
| [UI, platform, and DevTools](references/ui-platform-and-devtools.md) | Angular Aria, Material, CDK, locale data, images, profiling, inspection |
## Breaking changes and deprecations
- New Angular v22 applications use `OnPush` when a component omits
`changeDetection`. Use `ChangeDetectionStrategy.Eager` for the strategy
previously named `Default`. In 22.2.4, JIT-compiled components from libraries
built before Angular 22 default to `Eager` when they omit the strategy.
- `ChangeDetectorRef.checkNoChanges()` has been removed. Use
`fixture.detectChanges()` in component tests that called it. Replace
`TestBed.getFixture()` with `TestBed.getLastFixture()` for the latest fixture.
- Angular removed its Hammer.js integration. Applications using Angular's
Hammer-backed gesture events need to handle those gestures themselves.
- Angular CLI 19 removes the Protractor builder; projects using it need a
different end-to-end test target. CLI v21 deprecates its experimental Jest
and Web Test Runner integrations, with removal planned for v22.
- Angular v22 deprecates Webpack support, including the Webpack-based
`@angular-devkit/build-angular` builders and `@ngtools/webpack`.
- `ng update` adds an explicit `angularCompilerOptions.strictTemplates`
setting. Check it if the project relied on implicit template-checking defaults.
- A bound `data` on `<object>` requires a trusted resource URL. Angular applies
URL security checks to SVG animation attributes and rejects unsafe bindings.
The compiler rejects translation of an iframe's `src`; Angular also sanitizes
translated form attributes.
## Upgrade and compatibility checks
Run `ng update` one major at a time; each destination must still be supported
for the hop to qualify under Angular's update policy. Use the exact minor's
runtime and compiler ranges in the compatibility reference.
Angular 22.0.x requires Node.js `^22.22.3`, `^24.15.0`, or `^26.0.0` and
TypeScript `>=6.0.0 <6.1.0`. In 22.2.4, `@angular/compiler-cli` requires
`@jridgewell/sourcemap-codec` 1.6.0 or later; update overrides that pin older versions.
Developer Preview and Experimental APIs can change even in patch releases;
Experimental APIs may never stabilize. Critical security fixes can introduce
breaking public API changes, with explicit notice through Angular's official channels.
## Change detection and render effects
Angular 21 applications are zoneless by default unless configured with
`provideZoneChangeDetection()`. TestBed still defaults to zone-based change
detection when test polyfills load `zone.js`; add `provideZonelessChangeDetection()`
to the testing module's providers to force zoneless mode in that case.
When removing the `zone.js` polyfill from `angular.json`, add
`provideBrowserGlobalErrorListeners()` to bootstrap providers to forward uncaught
browser errors and unhandled promise rejections to Angular's error handler.
In zoneless mode, `NgZone.onMicrotaskEmpty`, `onUnstable`, and `onStable` never
emit, and `NgZone.isStable` is always `true`. Use `afterNextRender()` for one
post-render callback or `afterEveryRender()` for conditions spanning renders.
`NgZone.run()` and `runOutsideAngular()` remain compatible with zoneless mode.
In zoneless views, Reactive Forms `setValue()`, `patchValue()`, and `FormArray.push()`
update the model without scheduling component change detection. Connect the relevant
form observable to `ChangeDetectorRef.markForCheck()` or expose it as a signal the template reads.
In v19, view effects run before their component is checked, including effects in services
provided by that component. Move layout reads or effects depending on non-signal
view queries to `afterRenderEffect()`. Its later phases receive the preceding
phase's result as a signal; call it to read the value. The callback runs only in
the browser, and its component can still be dehydrated.
## Signals, resources, and dynamic components
Use `isWritableSignal()` to narrow to `WritableSignal` before `.set()` or `.update()`.
With `linkedSignal`'s `previous` argument, supply both generic types as
`linkedSignal<Source, Value>`; `previous.value` includes a manual selection.
`resource` and `httpResource` are stable in v22. A parameter change starts a fresh
load and clears the old result; `reload()` retains it during loading. Guard
`value()` with `hasValue()` to narrow away `undefined` and avoid error-state exceptions.
In 22.2.4, a signal read by `params` triggers loading only if the returned
parameter value changes. In 22.3.0, a parameter callback returning `undefined` cancels
an in-flight load; pass the loader's `abortSignal` to the underlying operation to respond to cancellation.
Read a submitted prompt in `params` to trigger loading. Read auxiliary signals,
such as a session ID, inside `loader` for their current values when loading runs;
changes to those auxiliary signals alone leave the current request in place.
Snapshot composition applies in versions exposing `Resource.snapshot`.
Pass `bindings` and `directives` to `createComponent()` to wire inputs, outputs,
and host directives. `inputBinding` takes a signal or getter; `twoWayBinding`
takes a writable signal. Use `{read: Injector}` on view or content queries to
retrieve the injector at the matched node.
## Signal Forms
Signal Forms are stable in v22, and Material controls support them. The experimental
API shipped in 21.0.0 uses `Field` and `[field]`; the field-tree guide uses
`FormField` and `[formField]`. See the forms reference for the scoped examples.
Create a field tree with `form(writableSignal)`. Initialize every bindable property:
an absent or `undefined` property has no node. Keep nested objects present with
empty leaf values. Track array field nodes by identity when rendering them.
Use `minLength(path.items, 1)` to reject an empty array, which passes `required()`.
The schema callback runs once. Put conditions in a rule's `when` callback and
use a function for changing numeric bounds. Pending async validation can leave
both `valid()` and `invalid()` false; `errors()` is a list of error objects.
`validateHttp()` starts after synchronous validation passes. `reloadValidation()`
reruns async validation; `validateAsync()` and `validateHttp()` accept `debounce`.
Where `FormRoot` is available, `[formRoot]` sets `novalidate` and routes native
submit events through `submit()`, which marks fields touched and runs the
configured action when valid. `submit(contactForm, {action})` supplies or overrides
the action. `contactForm().reset()` clears touched and dirty flags; passing a model
value replaces the data too. `FormRoot` can also be used without submission options.
Custom `FormValueControl` controls work with template-driven or Reactive Forms;
`ngNoCva` opts out of their `ControlValueAccessor`. In 22.2.5, a classic form binding
such a control supports `updateOn: 'blur'` and `updateOn: 'submit'`. The separate
`SignalFormControl` guidance in the forms reference covers its update timing and options.
## Server rendering and hydration
Register `ServerRoute[]` with `provideServerRendering` from `@angular/ssr`.
Add `withAppShell` for routes using `RenderMode.Client`. The default hybrid
configuration prerenders and emits a server entry point; `"outputMode": "static"`
emits a fully static build without one. Use `RenderMode.Server` for per-request rendering.
Catch-all prerender parameters use the literal key `'**'` and slash-separated
paths. The default fallback is `PrerenderFallback.Server`; use `PrerenderFallback.Client`
for client rendering or `PrerenderFallback.None` to leave ungenerated paths unhandled. In `getPrerenderParams()`,
call `inject()` before the first `await` when fetching parameter values through DI.
Top-level server `useValue` providers reuse their value across requests; use a
factory for request-specific state. `REQUEST`, `RESPONSE_INIT`, and `REQUEST_CONTEXT`
can be `null` during builds, prerendering, browser rendering, and route extraction
during a development request. Release `PendingTasks.add()` work in `finally`.
Nested hydration event triggers hydrate dehydrated ancestors first. `hydrate when`
can fire only with no dehydrated ancestor. `hydrate never` keeps the whole subtree
dehydrated on the initial server-rendered load; regular triggers and placeholders
still apply on later client-side renders.
Transfer-cache eligibility defaults to `GET` and `HEAD` without `Authorization`
or `Proxy-Authorization`; cached responses omit headers by default. Use
`includeHeaders` for selected headers, `includePostRequests` for read-only POSTs,
or `includeRequestsWithAuthHeaders` when auth headers leave response content unchanged.
`HTTP_TRANSFER_CACHE_ORIGIN_MAP` maps server API origins to browser API origins.
## Routing
`redirectTo` functions can resolve asynchronously. The Router handles a thrown
`RedirectCommand` as a redirect; in 22.2.4, an earlier guard's cancellation or
redirect takes precedence over a later guard's thrown redirect.
Router resources are public in 22.2.0; a resource on `ActivatedRoute` supports
`reload()`. In 22.3.0, resources react to input changes and can load in parallel
as dependencies become available. Enable route error boundaries with
`provideRouter(routes, withErrorBoundaries())` and set a route's `errorComponent`.
The Router warns if that property is set while the feature is disabled.
Opt into Navigation API integration with `withExperimentalPlatformNavigation()`.
It can intercept ordinary anchors and `RouterLink` and use native back/forward
scroll restoration. Router view transitions are stable in 22.3.0; enable them
with `provideRouter(routes, withViewTransitions())`.
## Templates and diagnostics
Stack consecutive `@case` labels for a shared body and use `@default never;`
to report unhandled union members. With `@for (item of items; track item.id)`,
changing `item.id` in place can keep the row view and its child components alive.
Set `angularCompilerOptions.typeCheckHostBindings` to `true` for host expressions
and `angularCompilerOptions.strictUnclaimedEventNames` to `true` for misspelled
output bindings. `strictStandalone` enforces standalone declarations; standalone
components can still import NgModules such as `FormsModule`.
In 22.3.0, unknown properties on explicit `<ng-template>` are reported: import the
input's directive or put DOM property bindings on the rendered element inside it.
The compiler rejects attribute/property names starting with `:` and reports
non-iterable `@for` collections. Supply units for numeric CSS values on properties
requiring them, for example `<div [style.width.px]="240"></div>`.
## Tests, build tools, and inspection
New CLI projects use Vitest with `jsdom`. For `happy-dom`, install it as a dev
dependency and uninstall `jsdom`. Put Angular test providers in a default-exported
array referenced by `providersFile`; list pre-test scripts with `setupFiles` and
include those TypeScript files in `tsconfig.spec.json`.
Run `ng generate config vitest` for `vitest-base.config.ts` and reference it with
`runnerConfig`. Select tests using target `include` and `exclude`: the CLI overrides
`test.projects` and `test.include` in custom config. After runner setup, the
experimental `ng generate @schematics/angular:refactor-jasmine-vitest` migrates tests.
For `httpResource` tests in versions with `TestBed.tick()`, configure
`provideHttpClient()` followed by `provideHttpClientTesting()`. Call `TestBed.tick()`
before `HttpTestingController.expectOne()`, flush the response, and await
`TestBed.inject(ApplicationRef).whenStable()` before asserting on `value()`.
For zoneless notification tests, await `fixture.whenStable()`; forcing
`fixture.detectChanges()` can hide a missing notification.
Run `ng generate @angular/core:signals` to migrate decorator-based inputs, outputs,
and queries together. Run `ng.enableProfiling()` before recording Chrome's
Performance panel for the Angular track. Enable custom formatters in Chrome or
Firefox to inspect signal values; Angular DevTools' Transfer State tab shows
server-to-client data. The UI reference covers Aria, Material, and CDK guidance.