Upgrade Angular 7.2 to Angular 8.0

Sherly Febrianti
2 min readJun 29, 2020

--

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.

Now, Angular 10 has been published!

If you see the guide, we should upgrade the version one by one to minimised too much error caused by the upgrade version.

Currently my application is using Angular verion 7.2.

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 :

Need to specify the static/dynamic content’s option.
Adding this flag will ensure your code works the same way when upgrading to version 9.

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!

--

--

Sherly Febrianti
Sherly Febrianti

Written by Sherly Febrianti

A passionate developer who loves design

No responses yet