• Tue. Nov 26th, 2024

Angular 19 to make standalone the default for components

Byadmin

Sep 4, 2024



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.



Source link