Using ngxtension to migrate towards "Modern" Angular
In recent versions, Angular has introduced a new set of APIs and features that are considered "modern" Angular.
The inject method, signal based inputs, and the new output method, immediately come to my mind.
These new APIs are not only more powerful but also more readable and easier to use.
That's why it's encouraged to use it in new projects.
But what about existing projects?
You can have a mix of old and new Angular code in your project, or you might want to migrate to the new Angular version.
I prefer the latter because it keeps things consistent, but in large codebases this can be a daunting task that consumes some time and effort.
To automate this task there's a tool that can help you with this: NG Extension (ngxtension), which is created by Chau Tran and Enea Jahollari.
This library provides a collection of utility methods to write Angular code, and it also provides a set of schematics to help you migrate to the new Angular APIs.
Let's see how we can use ngxtension to migrate towards "modern" Angular with some before and after examples.