Angular 19: Standalone updates

Angular 19 is a massive release with lots of improvements and new features. I covered all signal-related updates earlier. Today, let’s focus on what’s changed with standalone features in the framework.

First, standalone is the new default! In Angular 19, you don’t need the standalone: true option in your decorators, that’s the default value now. Instead, you want to use standalone: false for features that are not standalone and belong to a ngModule.

When you upgrade to Angular 19, ng update will automatically remove standalone : true where you use it and use standalone: false where needed. No need to worry about it!

Second, the Angular compiler will warn you when you have unused imports in your standalone components. This is great to help keep your code clean:

TS-998113: Imports array contains unused imports [plugin angular-compiler]

src/app/user/users.component.ts:9:27:
9 │ imports: [UserComponent, UnusedComponent],Code language: HTTP (http)

Finally, if you want to make sure all your components are standalone, you can use the new "strictStandalone": true option in the angularCompilerOptions.

Then, if your create a non-standalone feature, you’ll get an error:
TS-992023: Only standalone components/directives are allowed when 'strictStandalone' is enabled.

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.