Header Ads

  • How to Update your current version of Angular to Angular 6.0


    Upgrade your current version of Angular to Angular V - 6.0  Follow Simple Steps -

    Before getting started, make sure your app is already using the 
    new HttpClient module instead of the legacy Http module.

    I am going to explain general and simple steps of upgrading , if you have any issue so angular provided detailed guide of instructions  - https://update.angular.io/

    Simple Steps - 

    1. Make sure NodeJS version is 8.9+ if not update it. And go to your project directory if you have existing project

    2. Updating the CLI

    1st Check Version of Angular  -

    Go to your project folder and use this command - (should be > 2)
    ng version

    Update Angular cli globally and locally, and migrate the old configuration .angular-cli.json to the new angular.json format by running the following :

    # updating using npm
    $ npm i -g @angular/cli $ npm i @angular/cli

    # using Yarn $ yarn global add @angular/cli $ yarn add @angular/cli

    3. Update your current dependencies by angular 6 command -

       ng update @angular/cli

    4. Update all of your Angular framework packages to v6,and the correct version of RxJS and TypeScript by running the following:

    ng update @angular/core

    5. Update Angular Material to the latest version by running the following:

    ng update @angular/material

    6. RxJS v6 has major changes from v5, v6 brings backwards compatibility package rxjs-compat that will keep your applications working, but you should refactor TypeScript code so that it doesn't depend on rxjs-compat. For the same run following:

    npm install -g rxjs-tslint
    rxjs-5-to-6-migrate -p src/tsconfig.app.json

    Note :- Once all of your dependencies have updated to RxJS 6, remove rxjs- compat as it increases bundle size. please see this RxJS Upgrade Guide for more info.
    npm uninstall rxjs-compat

    Done . Check your app using ng serve , if found any issue so go to official upgration by Angular - 

    Topic - upgrading from angular to angular v6

    No comments

    Post Top Ad


    Post Bottom Ad