Updating Angular Material
In Chapter 4, Staying Up to Date with Angular Updates, we leveraged ng update
for an automated upgrade experience and also went over a manual and methodical approach to updating packages. We will follow a similar strategy when updating Angular Material.
You can use ng update
for a quick and painless upgrade experience, which should look like below:
$ npx ng update @angular/material Updating package.json with dependency @angular/cdk @ "6.0.0" (was "5.2.2")... Updating package.json with dependency @angular/material @ "6.0.0" (was "5.2.2")... UPDATE package.json (5563 bytes)
In addition, I have discovered the material-update-tool
published by the Angular team at https://github.com/angular/material-update-tool. In it's current form this tool is advertised as a specific Angular Material 5.x to 6.0 updater tool, so it may perhaps become part of ng update
like the rxjs-tslint
tool in the future. You may run the tool as shown below:
$ npx angular-material-updater...