Reputation: 47
I want to update an existed app that was developped by Angular 2 to the latest Angular 9, I found some tutorials
How to update angular 2 in Angular CLI How to upgrade Angular CLI to the latest version https://medium.com/@satyapriyamishra111/how-to-upgrade-angular-2-4-5-application-to-angular-6-85c7775896c2 https://update.angular.io/#2.0:9.0
I'm still new to angular so will I just want to know if I will need to change syntaxes within the code
Upvotes: 0
Views: 136
Reputation: 4888
Yes. Some of the Angular modules have changed, things like RxJS have changed (you didn't used to use .pipe, now you do), components have changed, configurations have changed.
Your best bet is to scaffold a new Angular 9 app, take the old app code (WITHOUT any of the configuration files, like the tsconfigs etc), and just slog through it.
I've had to update a number of fairly large Angular apps. Anything 6+ to the latest is pretty easy. Anything 4+ is not too bad, but is work. If you're going all the way back to 2, that can be painful.
This is all assuming the app you're updating is large. If it's relatively small, a handful of components living in the app.module, then it won't be too bad, you'll need to update HTTPModule to HttpClientModule and that sort of thing, and if you have any pipes for data (RxJS) you'll have to dig into that. But a large app with lots of assets, path configs, lots of modules loading lots of data...that'll take time.
Upvotes: 1