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 its 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 -p .\src\tsconfig.app.json √ Successfully migrated the project source files. Please check above output for issues that couldn't be automatically fixed.
If you're lucky and everything goes well, feel free to skip the rest of this section. For the rest of the...