I posted about how to update your version of Angular a while back. Still, with the ongoing updates in the framework, such as standalone components, the new control flow syntax, and the inject() function, there are quite a few new options that aren’t required but can still be adopted widely.
For instance, if you want to remove your ngModules
and go full-standalone; there’s a migration command for that:
![](https://www.angulartraining.com/daily-newsletter/wp-content/uploads/2024/08/image-2.png)
This command will ask you about different options, such as removing unnecessary ngModules
, and switching your AppComponent
to standalone bootstrapping.
If you want to get rid of NgFor
, NgIf
, and the like, you can migrate automatically to the new control flow syntax with:
![](https://www.angulartraining.com/daily-newsletter/wp-content/uploads/2024/08/image-3.png)
Another migration command was added in Angular 18.2. This one is to migrate your dependency injection syntax to use inject()
instead of constructors:
![](https://www.angulartraining.com/daily-newsletter/wp-content/uploads/2024/08/image-4.png)
Finally, and also added in Angular 18.2, is the migration to use lazy-loading on all routes:
![](https://www.angulartraining.com/daily-newsletter/wp-content/uploads/2024/08/image-5.png)
This last command can be applied to a subset of routes by using the path
argument:
![](https://www.angulartraining.com/daily-newsletter/wp-content/uploads/2024/08/image-6.png)
The official documentation for all these migrations can be found here.