Paul Krill
Editor at Large

Angular 19 to make standalone the default for components

news
Sep 4, 20242 mins

The standalone feature lets developers build apps that do not depend on NgModule and is now the recommended way to write Angular code.

1
Credit: 1

Angular 19, a planned update to the popular TypeScript-based web framework, is set to make standalone: true the default for components, directives, and pipes. This change, announced in an Angular blog post on September 3, eclipses the use of NgModules. With the new default, developers no longer need to type the standalone: true flag.

The announcement notes that a developer preview of the standalone feature was introduced with Angular 14 in June 2022. This made it possible to build applications that did not rely on NgModules, mechanism for organizing code in a modular structure. Standalone has since been stabilized and is now the recommended way to write Angular code. The Angular CLI generates components with standalone: true by default. Angular documentation also now teaches “standalone first” to new Angular developers.

Standalone makes Angular easier to learn and start using, and adoption has been strong across the Angular ecosystem, the post said.  It also enables new features. The directive composition API, for example, supports a better composition model for component behavior by allowing standalone directives to be applied in the declaration of a host component or directive. The deferrable views feature lazy-loads standalone components and directives at the template level to optimize Angular applications.

Angular’s builders do not intend to deprecate the standalone option or NgModules. said the post. Developers can still write NgComponents by specifying standalone: false in the component decorator. For existing standalone or NgModules code, plans call for applying an automated migration. A future Angular 19 update will remove standalone: true for existing standalone components and add standalone: false to existing NgModules to ensure they still work.

The current version of Angular 18 arrived May 22. Based on the schedule for previous releases, Angular 19 may be available sometime in November.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author