Upgrade Angular 7.2 to Angular 8.0
Hi CelSius, — that’s how i call my pal 😆
Currently i’m going to upgrade Angular version of my Angular application by following this Angular guide.
If you see the guide, we should upgrade the version one by one to minimised too much error caused by the upgrade version.
Upgrade the RxJS v5.x to v6
Angular 8 update are suggesting us to remove rxjs-compat
, so we have to update the RxJS to v6 by following this guide.
Re-install your rxjs :
npm uninstall rxjs --save
npm install rxjs@6 rxjs-compat@6 --save
You need to fixed your code breaking changes as described in guide.
Installing rxjs-tslint globally and do the migration :
npm i -g rxjs-tslint
rxjs-5-to-6-migrate -p [path/to/tsconfig.json]
Once the application and the dependencies has been updated to RxJS 6, remove rxjs-compat
.
Update the Angular Core and Angular CLI version
Updating the Angular to version 8 by running this command :
ng update @angular/cli@8 @angular/core@8
Make sure you are using Node 10 or later on your local.
Fixing all dependencies
After upgrading to Angular 8, you also have to update the Typescript to version 3.4.
If you are using ViewChild
or ContentChild
, be aware with the Static query migration, you will see this kind of error :
Summary
If you don’t like the long explanation, here is the checklist you have to do :
- Upgrade the RxJS v5.x to v6
- Update the Angular Core and Angular CLI version
- Fixing all dependencies
Now, you are good to go. Cheers!
The next thing you can do is upgrade your application from Angular 8.0 to Angular 10.0.