What’s new in Angular 15.2?

Angular 15.2 was released a few days ago. The main addition to this release is a new Angular CLI schematic to migrate your existing code to standalone components:

ng generate @angular/core:standalone

This schematic isn’t documented on the Angular website yet, as it’s still in its early stages. It looks like it has three options so far:

  • convert-to-standalone: Default option. Converts all components to standalone ones except those declared in your main AppModule.
  • prune-ng-modules: Deletes all modules that aren’t necessary anymore because their features have been migrated to standalone components.
  • standalone-bootstrap: Bootstraps your application with the bootstrapApplication function and migrates the components referenced in your AppModule.

I’ll post more information in the newsletter as this new schematic evolves.

Another update is that class-based guards are being deprecated, which means the Angular team is pushing for its new function-based router features.

Lastly, a new RouterTestingHarness utility has been added to help with unit-testing components loaded by the router. The Angular team released a short guide to explain how to use it.

Alain Chautard

Alain is a Google Developer Expert in Web Technologies, Angular, and Google Maps. His daily mission is to help development teams adopt Angular and build at scale with the framework. He has taught Angular on all six continents! A world traveler and photographer, Alain is also an international conference speaker, and a published author of several video courses.