Upgrade to Angular 7 in 5 Simple Steps

Angular helps to build modern applications for web, mobile, or desktop. Currently, Angular 7 is the latest version. Staying up-to-date with the latest version is very important. Upgrading to Angular 7 takes just a few simple steps:

First, upgrade the Angular version globally by adding the latest version via the terminal: sudo npm install -g @angular/cli@latest
Upgrade the version locally in your project and make sure the changes for the new version are reflected in the package.json fileng update @angular/cli
Upgrade all your dependencies and dev dependencies in package.json
Dependencies:

npm install –save @angular/animations@latest @angular/cdk@latest @angular/common@latest @angular/compiler@latest @angular/core@latest @angular/flex-layout@latest @angular/forms@latest @angular/http@latest @angular/material@latest @angular/platform-browser@latest @angular/platform-browser-dynamic@latest @angular/router@latest core-js@latest zone.js@latest rxjs@latest rxjs-compat@latest

Dev Dependencies:

npm install –save-dev @angular-devkit/build-angular@latest @angular/compiler-cli@latest @angular/language-service @types/jasmine@latest @types/node@latest codelyzer@latest karma@latest karma-chrome-launcher@latest karma-cli@latest karma-jasmine@latest karma-jasmine-html-reporter@latest jasmine-core@latest jasmine-spec-reporter@latest protractor@latest tslint@latest rxjs-tslint@latest webpack@latest

Angular-devkit was introduced in Angular 6 to build Angular applications that required dependency on your CLI projects.
Also, you’ll need to upgrade the version for Typescriptnpm install typescript@2.9.2 –save-dev

Now, migrate the configuration of angular-cli.json to angular.jsonng update @angular/cli ng update @angular/coreIf Angular material is used, use this command:ng update @angular/material
Remove deprecated RxJS 6 features npm install -g rxjs-tslint   rxjs-5-to-6-migrate -p src/tsconfig.app.json(Please, be patient and wait until the execution completes).
Now, uninstall rxjs-compat as it is an unnecessary dependency for Angular 7.npm uninstall –save rxjs-compat
Also changeimport { Observable } from ‘rxjs/Observable’;  toimport { Observable } from ‘rxjs’;

Finally, start your Angular 7 application using ng serve.

Link: https://dzone.com/articles/upgrade-to-angular-7-in-5-simple-steps-1?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev