How to update Angular 4,5, 6 to Angular 7?

devquora
devquora

Posted On: Feb 22, 2018

 

  • First of all, you need to update the Angular version globally by inserting the latest version via the terminal: sudo npm install -g @angular/cli@latest.
  • The next step is to upgrade the version locally in your project and need to assure the altering for the new version are displayed in the package.json file ng update @angular/cli
  • When it is done, upgrade all your dependencies and dev dependencies in package.json
  • To build Angular applications, Angular-devkit was introduced in Angular 6 that needs the dependency on the CLI projects.
  • With all of this, you'll also require to upgrade the version for Typescriptnpm install typescript@2.9.2 --save-dev
  • Then, you need to relocate the configuration of angular-cli.json to angular.json ng update @angular/cli and ng update @angular/core.
  • Use this command: ng update @angular/material in case of Angular material is used.
  • The next step is the removal of deprecated RxJS 6 features npm install -g rxjs-tslint rxjs-5-to-6-migrate -p src/tsconfig.app.json
  • When it is done, uninstall rxjs-compat as it is not required for Angular npm uninstall --save rxjs-compat
  • Also change import { Observable } from 'rxjs/Observable'; to import { Observable } from 'rxjs';
  • Finally, you are able to start your Angular 7 application by using ng serve

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    Angular 7 Interview Questions

    What's new in Angular 7?

    Angular Elements is enabled to support content projection with the help of web standards for custom elements...

    Angular 7 Interview Questions

    What is IVY Renderer? Is it supported by Angular 7?

    Angular will be releasing a new kind of rendering pipeline and view engine...

    Angular 7 Interview Questions

    What are the Core Dependencies of Angular 7?

    Core DependenciesThere are two types of core dependencies: RxJS and TypeScript...