What's new in Angular 22.3?
Angular 22.3.0 is here!
Angular 22.3 is the third minor release of the v22 cycle, with a focus on build performance, thanks to the work on the Rust-based compiler and a new library builder. It also brings router error boundaries, stricter template checks, and a few other goodies. Let's dive in!
A faster compiler in Rust
A major focus of the Angular team is the new ngp compiler,
partly written in Rust, which aims to speed up builds and rebuilds.
As we were pretty curious about how it works and how much faster it is, we wrote a dedicated blog post:
👉How much faster is the new Angular compiler?
Note that some template warnings won't be available in ngp,
as the new compiler does not rely on the TypeScript type checker to analyze the templates.
This is a trade-off for performance,
but it means some uncalled functions or signals in templates won't be caught
(at least in the current version; maybe this will be improved in the future).
RIP Selectorless and signal components
The team also removed two unfinished prototypes from the codebase:
signal components (signals: true) and selectorless components.
Neither was available as a supported feature, so it's not a big loss,
but selectorless components were looking good as you can see in our blog post,
so I'm a bit sad to never get this one 😞.
Templates
strictUnknownElements
A new optional compiler flag, strictUnknownElements, has been added.
It catches unknown elements that were previously silently accepted when matched by an attribute directive.
For example, consider this template:
<custom-color-picker formControlName="color" />
With ReactiveFormsModule imported, this template previously compiled even if CustomColorPicker was missing from the component’s imports.
With strictUnknownElements: true, the compiler now reports an NG8001: 'custom-color-picker' is not a known element error.
The option defaults to false in v22.3 and is planned to be enabled by default in v23.
strictNgTemplateTypes
Another optional compiler flag, strictNgTemplateTypes, detects unknown property bindings on <ng-template> elements that were previously silently ignored.
For example, a typo in ngTemplateOutlet:
<ng-template [ngTemplateOutet]="content"></ng-template>
With strictNgTemplateTypes: true, the compiler now reports an NG8002: Can't bind to 'ngTemplateOutet' since it isn't a known property of 'ng-template' error.
I would have thought this was already caught, but it appears it wasn't!
The option defaults to false in v22.3, but the check is intended to become enabled by default in the next major release, as strictUnknownElements
numericCssPropertyRequiresUnit
A new extended diagnostic, numericCssPropertyRequiresUnit, is enabled by default when strictTemplates is enabled in v22.3.
It detects non-zero numeric literals, including numeric string literals, bound without a unit to supported CSS length properties:
<!-- 👇does not set the height -->
<div [style.height]="200"></div>
This template now produces the following warning by default:
NG8119: Binding a number to the CSS property 'height' will have no effect. CSS requires units for length values.
For example, use [style.height.px]="200" or [style.height]="'200px'" instead.
The check allows unitless zero and properties such as opacity that accept unitless numbers.
It does not currently check values read from component properties or other non-literal expressions.
Syntax
A small addition to the template syntax: you can now use the increment (++) and decrement (--) operators in event handlers:
<button (click)="count++">Increment</button>
Both prefix and postfix forms are supported (++count, count++, --count, and count--), with the same behavior as in JavaScript.
Router
Resources
In v22.2, we introduced one of the new features of the router: router resources.
{
path: 'races',
component: Races,
// 👇context contains params, queryParams, etc as signals
resources: context => {
const page = computed(() => context.queryParams()['page']);
const races = httpResource<Array<RaceModel>>(() => `/api/races?page=${page()}`);
// return a key/value object
// - the key is the name of the data
// - the value is the resource
return { races };
}
}
In v22.3, the context gains a new resources key containing a signal that exposes the ancestor routes' resources.
For example, let's say you have a parent route users/:id and a child route users/:id/posts.
Fetching the posts requires information from the user,
the authorId for example, as showcased in our blog post explaining how to chain resources.
So you want the router resource fetching the posts to depend on the router resource from the parent route.
This is now possible:
{
path: 'users/:id',
component: Users,
resources: context => {
const id = computed(() => context.params()['id']);
const user = httpResource<UserModel>(() => `/api/users/${id()}`);
return { user };
},
children: [
{
path: 'posts',
component: Posts,
// 👇context now contains parent resources as a signal
resources: context => {
const posts = httpResource<Array<PostModel>>(({ chain }) => {
// the resource must be read in a reactive context
// and manually typed (default type is Resource<unknown>)
const userResource = context.resources()['user'] as Resource<UserModel>;
const user = chain(userResource);
return `/api/posts?authorId=${user.authorId}`;
});
return { posts };
}
}
]
}
Here the user resource from the parent route is used by the child route,
and the posts are only fetched when the user details are fetched.
When the parent resource changes,
the child resource reacts to that change and fetches the corresponding posts.
Note that the parent resource must be accessed inside a resource's params function (or request callback passed to httpResource),
otherwise it might not be available, and Angular throws:
NG04020: Router resources should be accessed inside a resource's 'params' (e.g. 'resource({ params: ({chain}) => chain(ctx.resources()["name"]) })').
With withComponentInputBinding(), the parent resource can also be bound to a component input,
just like the route's own resources:
export class Posts {
// 👇this was already possible
readonly posts = input.required<Array<PostModel>>();
// 👇this is new
readonly user = input.required<UserModel>();
}
Error fallback component
Another addition of v22.2 was the boundaries feature. The feature is still in developer preview but the router can now leverage it as well.
A new withErrorBoundaries() function is available to configure the router (in developer preview as well),
enabling boundaries for routes.
This feature allows us to display a fallback component when a route fails
because the component threw an error during creation or rendering, including when reading the value of a failed resource.
This does not handle navigation errors like errors from guards, resolvers, or blocking route resources.
This component can be globally configured in withErrorBoundaries():
provideRouter(
routes,
withComponentInputBinding(),
withErrorBoundaries({
// 👇 Default fallback component for routes
defaultErrorComponent: RouteErrorFallback,
// 👇Also allows to define an action to do when an error arises
onError: (error, details) => {
// Call a logger API for example
}
})
);
Or the component can be configured/overridden for a route,
using a new key errorComponent:
{
path: 'users/:id',
component: User,
// 👇
errorComponent: UserErrorFallback
},
When you navigate to /users/12,
if User throws an error during creation or rendering,
then the router instantiates UserErrorFallback inside the <router-outlet> instead.
The fallback components can access the error and the other parameters via input bindings:
@Component({
selector: 'ns-user-error-fallback',
template: `
<h1>Ohoh! Failed to load user #{{ id() }}</h1>
<p>{{ error()?.message }}</p>
`
})
export class UserErrorFallback {
readonly error = input<Error>();
readonly id = input<string>();
}
Unlike the @boundary feature in templates, there is no explicit "reset" API yet.
If you try to use errorComponent in a route without the withErrorBoundaries() configuration,
the router logs a warning in the browser console:
The route 'users/:id' defines an 'errorComponent', but router error boundaries are not enabled. Add 'withErrorBoundaries()' to 'provideRouter' for it to take effect.
View transitions are stable
Angular v17 introduced withViewTransitions() as an experiment
to enable view transitions in an application.
By default, you get a nice fade-in/fade-out transition between views when navigating from one route to another. You can customize the animation using CSS, animate the whole view or skip part of it, or indicate which DOM elements are in fact the same entities in the old and new views: the browser will then do its best to animate between the states.
This feature is now stable, as all major browsers support it!
I really like this feature. If you want to see what this can achieve, try navigating from our book catalogue to a book page: the cover and title move into their new positions! We also use view transitions when opening an article from our blog.
Scroll and Navigation API
When scroll restoration is enabled with
withInMemoryScrolling({ scrollPositionRestoration: 'enabled' })
(or 'top'), the router normally scrolls to the top after a forward navigation,
even one that only changes a query parameter.
You can opt out of scrolling for a navigation by setting scroll to 'manual'
in its NavigationBehaviorOptions.
This was already possible programmatically,
and is now also possible via an input of the RouterLink directive in v22.3:
<a routerLink="/users" [queryParams]="{ sort: 'asc' }" scroll="manual">Sort</a>
This is useful for tabs or filters further down the page:
the URL changes, but the router leaves the scroll position alone.
The default behavior, 'after-transition', follows the router's scrolling configuration.
The new input also works when the router uses the browser Navigation API
via withExperimentalPlatformNavigation
(which is, you get it, still experimental).
Focus control
Speaking of the experimental browser Navigation API support: when the router uses it, the browser resets focus after each navigation. This can be painful if you have a simple search form, as the user will lose focus in the input if they enable a filter that triggers a navigation to set a query parameter.
To avoid that, a new option has been added to NavigationBehaviorOptions: focusReset.
Like the scroll option, it can be set to:
'after-transition'(the default), the browser moves focus to the first element with theautofocusattribute, or to the<body>'manual', the browser doesn't reset focus.
Unlike the scroll option,
this option only applies when using withExperimentalPlatformNavigation, and is itself experimental.
Navigation in tests
The RouterTestingHarness gained a new navigate() method,
in addition to its existing navigateByUrl().
This mirrors what can be done with the router,
where you can use both.
navigate() allows you to specify NavigationExtras
(including options that aren't in the URL, like state, skipLocationChange, or replaceUrl).
You previously had to inject the router and use its navigate method to do so.
Defer
@defer now allows you to define a scroll margin when using the viewport trigger (in addition to rootMargin and threshold).
scrollMargin is a fairly specific option
of the IntersectionObserver API.
Unlike rootMargin, scrollMargin expands the clipping bounds of nested scroll containers.
This allows deferred content to be loaded or prefetched before it enters the visible area of a nested scroller.
AI
The WebMCP API introduced as an experiment in v22
has allowed you to define annotations in a tool declaration since v22.2.
In v22.3, a new annotation is supported: debugging.
It indicates if the tool is intended for debugging and development purposes
rather than end-user agent interaction.
Signal forms exposed as tools via experimentalWebMcpTool are automatically configured with debugging: false.
HTTP
Have you ever had to change an API from GET to POST because you needed to pass too many parameters
and were limited by the length of a GET request URL?
Well, the HTTP spec introduced a new method, called QUERY,
defined in RFC 10008.
QUERY allows safe, idempotent queries with a request body.
HttpClient now supports the HTTP QUERY method via http.query(url, body, options) in v22.3.
Your server must support this HTTP method of course.
http.query<Array<UserModel>>('/api/users/search', {
roles: ['admin', 'editor'],
active: true
});
QUERY requests are also eligible for Angular's SSR transfer cache by default,
alongside GET and HEAD requests.
CLI
New library builder
Most of the work done in this CLI release is about a new library builder,
replacing ng-packagr, called @angular/build:library.
ng-packagr is a standalone project, while the new builder is in the CLI project,
and shares lots of code with the other builders.
The new architecture of this builder should bring better performance, mostly to incremental rebuilds when updating TS or SCSS files in the lib and for libraries that are using multiple entry points. Some quick benchmarks show roughly 2–4× faster incremental rebuilds.
Newly generated libraries now use this builder by default.
The CLI also provides a new ng generate entry-point testing --project=my-lib schematic to generate a secondary entry point,
allowing consumers to import its APIs from my-lib/testing.
This schematic is only available for libraries using the new builder.
The CLI team provided an optional migration that you can run,
to migrate from ng-packagr to @angular/build:library.
The migration is optional, but the older @angular/build:ng-packagr builder is now deprecated
and logs a warning recommending the new builder:
ng update @angular/cli --migrate-only --name=use-library-builder
I migrated the two small OSS libraries that we maintain (ngx-valdemort and ngx-speculoos): the migration was super simple! No real performance gains that I could spot, to be honest, though 🤷. As the libraries are quite small, I suppose we don't really see the benefits of the new build pipeline.
Tests
Small addition: the unit-test builder now allows you to set the polyfills option.
The polyfills were previously always inherited from the buildTarget, and can now be overridden.
The --test-runner option is now deprecated when generating applications and libraries.
Selecting Karma is still possible for now,
but newly generated projects will only be configured with Vitest in a future version.
SSR
It is now possible to pre-render routes as <name>.html instead of <name>/index.html.
This feature is inspired by Astro, SvelteKit, Hugo and others
and can be enabled via prerender.format, which you set to 'file' (instead of the current default 'directory').
This is useful if you use static hosting that serves /foo.html for /foo, as it avoids a redirect,
but not if you produce a server (the option is then ignored as @angular/ssr expects the directory layout).
Formatting
I'm happy to present this new feature as I'm the one who introduced it 😉:
the CLI can now use your oxfmt config to format files generated via ng generate!
It only supported Prettier until now:
a CLI project created via ng new is nowadays generated with a Prettier config and dependency out of the box.
We don't have (yet) the possibility to create a project with oxfmt directly,
but oxfmt now lets you configure Angular template formatting regardless of the filename
as the remaining blocking issue has been closed recently.
So you can remove Prettier and add oxfmt,
and the CLI now checks both and picks the formatter found, preferring Prettier when both are installed, to format the generated component, service, pipe, etc.
Summary
That's all for this release. Stay tuned!
All our materials (ebook, online training and training) are up to date with these changes if you want to learn more!
← Older post
How much faster is the new Angular compiler?
Our books on sale


Next training sessions
- From Dec 14 to Dec 17, 2026Angular: Ninja to Hero(remote)
- From Feb 15 to Feb 18, 2027Vue: Zero to Ninja(remote)
- From Mar 22 to Mar 25, 2027Angular: Zero to Ninja(remote)
