Is it worth to migrate from Angular 2 to Angular 4?

前端 未结 3 1254
栀梦
栀梦 2020-12-13 04:23

Hello SO community and Angularians!

So, I am midway developing a huge platform in Angular 2. And I realized that many external libraries and dependencies for Angular

3条回答
  •  自闭症患者
    2020-12-13 05:08

    Angular team has announced , let's not call angular 2 or angular 4 let's call it Angular and there will be major update for every 6 months.I have faced the issue in angular v4.0.0 so change the configuration in webpack

      new webpack.ContextReplacementPlugin(
                    // The (\\|\/) piece accounts for path separators in *nix and Windows
                    /angular(\\|\/)core(\\|\/)@angular/,
                    helpers.root('./src'), // location of your src
                    {} // a map of your routes
                ),
    

    And install @angular/animations package and import in app.module.ts file

    import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
    
    @NgModule({
        imports: [
            BrowserAnimationsModule
        ]
    })
    

    I will prefer to update to latest version of angular. Angular V4.0.0 has reduced the packages weight and they have increased the performance.

提交回复
热议问题