This is a weekly posting, covering the latest updates from the Angular community.
Angular 14 - Standalone Components & APIs
Angular 14 is out. It is a big release, comparable even to version 9. But where Angular 9 was more like an enabler without new features, we have them now.
The most anticipated feature is the Standalone Components along necessary new functions for bootstrapping and routing, also known as Standalone APIs. It will remove the need for NgModules, but it is backward-compatible. So you can mix both approaches, which allows a smooth migration and not just a big bang.
Standalone Components are a developer preview. This means that by default, the Angular CLI still generates components in the old way. To enable them, you don't have to anything special. You can manually add the standalone property to your TypeScript class or add the standalone flag when you run ng generate.
Angular 14 - Typed Forms
The other main feature is typed forms. This is not a developer preview, but you will see that the migration script will not apply them. What happens instead, is that all your FormGroup or FormControl elements are transformed to an untyped version, and you can make them type-safe by using the old types again. Type safety is achieved via type inference. So in most cases the types are recognized automatically.
All the FormControls are a union type of undefined, null, or the actual type. This is because when a FormControl is reset, it turns to null by default, and if you disable it, its value is undefined.
Angular 14 - Miscellaneous
Other than that, we have a lot of other new features. Like the title property in the Router configuration, the inject function or new components for the CDK.
Angular@angular๐ฃ Standalone components are in developer preview
1. Read our release blog to learn how we're streamlining the authoring of Angular apps
๐ goo.gle/angular-v14
2. Try "ng generate component <name> --standalone" and tell us what you think #ngUpdate
angular.io/guide/standaloโฆ18:14 PM - 03 Jun 2022
Cypress 10
Last but not least, we have had another big release this week, and that Cypress version. It comes with a beta version for component testing. Unfortunately it is still missing support Angular.
Top comments (0)