Skip to content
Back to skills

Angular Knowledge Patch

ASecurity

Angular

  • 25 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added May 27, 2026
developmenttypescriptrustshellreactangularnodeexpresstestingapisecurity

Works with

  • cli
  • api
  • mcp

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add Nevaberry/nevaberry-plugins --skill angular-knowledge-patch --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Angular Knowledge Patch?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Angular Knowledge Patch
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nevaberry-angular-knowledge-patch/badge)](https://www.skillsdirectory.com/skills/nevaberry-angular-knowledge-patch)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: angular-knowledge-patch
description: Angular
version: "22.3.0"
license: MIT
metadata:
  author: Nevaberry
---


# Angular Knowledge Patch

Use this skill when upgrading Angular or working on change detection, signals,
forms, templates, server rendering, routing, tests, build tooling, or UI libraries.
The quick reference highlights compatibility decisions and common APIs.
Read the relevant topic reference for complete examples and version-specific details.

## Reference index

| Reference | Topics |
| --- | --- |
| [Compatibility, security, and releases](references/compatibility-security-and-releases.md) | Runtime and compiler requirements, browser support, upgrade policy, sanitization, CSP |
| [Core reactivity](references/core-reactivity.md) | Change detection, render effects, signals, resources, dynamic components, dependency injection |
| [Signal Forms](references/signal-forms.md) | Field trees, validation, submission, interaction state, classic forms, custom controls |
| [SSR, hydration, and routing](references/ssr-hydration-and-routing.md) | Server routes, request state, pending work, transfer cache, HTTP, navigation, route resources |
| [Templates and animations](references/templates-and-animations.md) | Expressions, control flow, deferred views, diagnostics, styles, error boundaries, animations |
| [Testing and tooling](references/testing-and-tooling.md) | Test runners, fixtures, migrations, generation, builds, CLI MCP, WebMCP |
| [UI, platform, and DevTools](references/ui-platform-and-devtools.md) | Aria, Material, CDK overlays, images, locale data, profiling, state inspection |

## Breaking changes and deprecations

Run `ng update` one major at a time for a multi-major upgrade. Each destination
must still be supported for the hop to qualify under Angular's update policy.
Choose Node.js, TypeScript, and RxJS ranges for the exact Angular minor; the
compatibility reference preserves the individual ranges and support dates.

New v22 applications use `OnPush` when a component omits `changeDetection`.
Use `changeDetection: 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 a strategy.

`ChangeDetectorRef.checkNoChanges()` was removed in 22.0.0. Use
`fixture.detectChanges()` in component tests that called it. Replace
`TestBed.getFixture()` with `TestBed.getLastFixture()` for the most recent fixture.
The update migration adds an explicit `angularCompilerOptions.strictTemplates`
setting; check it if the project relied on implicit template-checking defaults.

Angular removed its Hammer.js integration. Applications depending on its
Hammer-backed gesture events need to handle those gestures themselves.
Angular CLI 19 removes the Protractor builder, requiring a different end-to-end
test target for projects using it.

Angular v22 deprecates Webpack support, including the Webpack-based
`@angular-devkit/build-angular` builders and `@ngtools/webpack`.
The CLI's experimental Jest and Web Test Runner integrations are deprecated in
v21, with removal planned for v22.

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`; translated form attributes
are sanitized. The 22.2.1 URL sanitizer blocks `vbscript:` and accepts `data:` URLs
only for allowlisted MIME types.

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 detection
when test polyfills load `zone.js`; add `provideZonelessChangeDetection()` to the
testing module's providers to force zoneless mode in that case.
Await `fixture.whenStable()` to exercise application change notifications;
forcing `fixture.detectChanges()` can hide a missing notification.

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 a one-time
post-render callback or `afterEveryRender()` when the condition spans renders.
`NgZone.run()` and `runOutsideAngular()` remain compatible with zoneless mode.

In v19, view effects run before their component is checked, including effects
from services provided by that component. Move layout reads or effects depending
on non-signal view queries to `afterRenderEffect()`.
Later render phases receive the preceding phase's result as a signal: call it.
The callback runs only in the browser, and its component can still be dehydrated.

## Signals, resources, and dynamic components

Use `isWritableSignal()` from `@angular/core` to narrow to `WritableSignal` before
calling `.set()` or `.update()`. When using `linkedSignal`'s `previous` argument,
supply both generic types as `linkedSignal<Source, Value>`; `previous.value`
includes a manual selection, and `previous.source` is the prior source.

A resource parameter change starts a fresh load and clears the old result;
`reload()` keeps the prior result available during loading. Guard `value()` with
`hasValue()` to narrow away `undefined` and avoid a runtime exception in the error state.
In versions exposing `Resource.snapshot`, use `resourceFromSnapshots()` with a
derived snapshot signal to expose it as a resource.

Read request triggers in `params` and auxiliary signals inside `loader`.
Changes to those auxiliary signals alone leave the current request in place.
In 22.2.4, a change to a signal read by `params` triggers a load only if the
returned parameter value changes. In 22.3.0, returning `undefined` cancels the
in-flight load; pass the loader's `abortSignal` to the underlying operation so
it can respond to cancellation.

`resource` and `httpResource` are stable in v22. The reference keeps the experimental
signal-stream example and the v19.2 observable `loader` example with their own scope.
For `httpResource` download progress, set `reportProgress: true`; in 22.2.1 the
resource forwards the flag as `reportDownloadProgress`.

Pass `bindings` and `directives` to `createComponent()` to connect inputs and
outputs and apply host directives. `inputBinding` takes a signal or getter;
`twoWayBinding` takes a writable signal. Use `NgComponentOutlet`'s
`environmentInjector` input to supply providers to the dynamic component.

## Signal Forms and classic forms

Create a field tree with `form(writableSignal)` from `@angular/forms/signals`.
The field-tree guide uses `FormField` and `[formField]`; the experimental API
shipped in 21.0.0 uses `Field` and `[field]`. Signal Forms are stable in v22, and
Angular Material controls support them. The reference preserves both binding examples.

Initialize every bindable property: absent or `undefined` properties have no
field tree node. Keep nested objects present with empty leaf values.
For arrays, use `applyEach()` for item rules, `minLength(path.items, 1)` to reject
an empty array that passes `required()`, and track field nodes by identity.

The schema callback runs once. Put conditions in a rule's `when` callback and
use a function for a changing numeric bound. Pending asynchronous validation
can leave both `valid()` and `invalid()` false; read `errors()` as a list.
`validateHttp()` starts after synchronous validation passes.
Use `reloadValidation()` to retry async validation for the current field value;
`validateAsync()` and `validateHttp()` accept a validator `debounce` option.

Where `FormRoot` is available, `[formRoot]` sets `novalidate` and routes native
submit events through `submit()`. Manual `submit(contactForm, {action})` supplies
or overrides the action. `reset()` clears touched and dirty state; passing a
model value also replaces the data.

A `FormValueControl` works with template-driven or Reactive Forms. Add `ngNoCva`
on the control element to opt out of its `ControlValueAccessor`.
In zoneless views, `setValue()`, `patchValue()`, and `FormArray.push()` update the
form model without scheduling component change detection. Connect the relevant
form observable to `ChangeDetectorRef.markForCheck()` or expose it as a signal
that the template reads.

## SSR, hydration, and HTTP

Register the separate `ServerRoute[]` table with `provideServerRendering` and
`withRoutes` from `@angular/ssr`. Add `withAppShell` for `RenderMode.Client` routes.
The default hybrid configuration prerenders and emits a server entry point;
`"outputMode": "static"` emits a fully static build without a server entry point.

For catch-all prerender parameters, return the slash-separated path under `'**'`.
The fallback defaults to `PrerenderFallback.Server`; select
`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 `useValue` server providers reuse the same value across requests.
Use a factory for state belonging to each request. `REQUEST`, `RESPONSE_INIT`,
and `REQUEST_CONTEXT` can be `null` during builds, prerendering, browser rendering,
and route extraction during a development request.
For custom asynchronous work that must finish before serialization, call the
cleanup function returned by `PendingTasks.add()` in `finally`.

A nested hydration event hydrates 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 to subsequent 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 response headers, `includePostRequests` for read-only
POSTs, and `includeRequestsWithAuthHeaders` when auth headers leave content unchanged.
`HTTP_TRANSFER_CACHE_ORIGIN_MAP` maps server API origins to browser API origins.

## Routing and templates

Opt into Navigation API integration with
`provideRouter(routes, withExperimentalPlatformNavigation())`.
When a custom `RouteReuseStrategy` evicts a cached route, call
`destroyDetachedRouteHandle(handle)`. Automatic cleanup of inactive route injectors
is stable in 22.2.0.

Router resources are public in 22.2.0; call `reload()` on an `ActivatedRoute`
resource to refresh it. 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 `errorComponent` on a route. The Router warns if a route sets it while
the feature is disabled. Router view transitions are stable in 22.3.0;
enable them with `provideRouter(routes, withViewTransitions())`.

Stack consecutive `@case` labels for a shared body and use `@default never;`
to report unhandled union members. An in-place change to an `@for` tracking key
can leave the row view and child component instances alive when the same item
object remains in place; the next check updates bindings and changed inputs.

Angular 22.3.0 reports unknown properties on explicit `<ng-template>` elements:
import the directive providing the input, or put DOM property bindings on the
rendered element inside the template. It rejects attribute and property names
starting with `:` and reports non-iterable `@for` collections and numeric CSS
values on properties that require units.
Use a unit in the style binding, such as `<div [style.width.px]="240"></div>`.

## Testing, migrations, and UI tools

New CLI projects in the platform guide use Vitest with `jsdom`. Configure
`setupFiles` and `providersFile` on `@angular/build:unit-test`, and include the
TypeScript files in `tsconfig.spec.json`. Use test-target `include` and `exclude`
because the CLI overrides `test.projects` and `test.include` in custom Vitest config.

In versions with `TestBed.tick()`, provide `provideHttpClient()` before
`provideHttpClientTesting()`. Call `TestBed.tick()` to issue an `httpResource`
request before `HttpTestingController.expectOne()`. Flush the response and await
`TestBed.inject(ApplicationRef).whenStable()` before asserting on `value()`.

Run `ng generate @angular/core:signals` to migrate decorator-based inputs, outputs,
and queries together. The tooling reference also covers the experimental
Jasmine-to-Vitest schematic and migrations for `RouterTestingModule`, `NgClass`,
and `NgStyle`.

Angular Aria is stable in v22, supports Signal Forms, and has test harnesses for
its accessibility patterns. For profiling, run `ng.enableProfiling()` before
recording in the browser Performance panel. Enable custom formatters in Chrome
or Firefox DevTools to inspect a signal's current value.

Files in this skill

  • SKILL.md5.4 KB
  • references/components-and-templates.md684 B
  • references/signal-forms.md1.8 KB
  • references/signals-and-reactivity.md2.4 KB
  • references/ssr-and-hydration.md1.5 KB
  • references/zoneless-and-testing.md695 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.