Angular
Angular 9 Part 2 - Making the Update
  •  

Ng Update to the Rescue

PRO

Let's take a dive into the actual update process.

But first... Do you remember one thing that you had to do prior to upgrading to version 9 in order to make the upgrade successful? Go back through the previous videos if you can't remember.

The ng Update command enables us to easily update from one version to another version using the Angular CLI.

1️⃣ To get started, make sure you're on the latest release of Angular version 8.

2️⃣ Commit

3️⃣ Checkout v9 branch

4️⃣ Update to Angular v9

5️⃣ Review

6️⃣ Commit

This is what the update command looks like:

$ ng update @angular/cli @angular/core

Migrations

  • Lazy loading syntax migration

  • Static flag migration

  • Missing @Injectable and incomplete provider definition migration

  • ModuleWithProviders migration

  • Renderer to Renderer2 migration

  • Undecorated classes with decorated fields migration

  • Undecorated classes with DI migration

For those doing localization in i18n, after you run the ng update command, you need to run an additional command in your terminal, which is ng add. It will look like this:

$ ng add @angular/localize