Dismiss
Announcing Stack Overflow Documentation

We started with Q&A. Technical documentation is next, and we need your help.

Whether you're a beginner or an experienced developer, you can contribute.

Sign up and start helping → Learn more about Documentation →

I want to migrate from angular2 rc4 to rc5

and I'm not able to lanch my project

boot.ts

'use strict';
import { browserDynamicPlatform } from '@angular/platform-browser-dynamic';
import {AppModule} from "./AppModule";



browserDynamicPlatform().bootstrapModule(AppModule)
.catch(err => console.error(err));

this is my AppModule.ts

@NgModule({
    imports: [
        BrowserModule,
        FormsModule,
        routing
    ],
    declarations: [
        AppComponent,
        loginComponent
       // CrisisListComponent
    ],
    providers: [
        appRoutingProviders
    ],
    bootstrap: [ AppComponent ]
})
export class AppModule {
}

and my appRouting

const appRoutes: Routes = [
    {path: '', component: loginComponent},
    {path: 'login', component: loginComponent},

];

export const appRoutingProviders: any[] = [
   ]

export const routing = RouterModule.forRoot(appRoutes);

and I getting this error

enter image description here

share|improve this question
up vote 1 down vote accepted

I should comment first to ask my question, but I don't have enough reputation so I'll ask them here in my answer :

  • Did your forms work in RC4 before upgrading to RC5 ?
  • Did you make sure you upgraded all the packages to RC5 ?
  • Also, you should check your systemjs.config.js, the problem could be coming from there as well.

I think it's coming from your "@angular/forms": "0.3.0" package, which is not up to date, but I'm not sure and I need more information to be sure of it, but if that's the case, you should check this out :

My package.json file with the last versions is looking like that :

"dependencies": {
    "@angular/common": "2.0.0-rc.5",
    "@angular/compiler": "2.0.0-rc.5",
    "@angular/core": "2.0.0-rc.5",
    "@angular/forms": "0.3.0",
    "@angular/http": "2.0.0-rc.5",
    "@angular/platform-browser": "2.0.0-rc.5",
    "@angular/platform-browser-dynamic": "2.0.0-rc.5",
    "@angular/router": "3.0.0-rc.1",
    "@angular/router-deprecated": "2.0.0-rc.2",
    "@angular/upgrade": "2.0.0-rc.5",

    "angular2-in-memory-web-api": "0.0.15",

    "systemjs": "0.19.36",
    "core-js": "^2.4.0",
    "reflect-metadata": "^0.1.3",
    "rxjs": "5.0.0-beta.11",
    "zone.js": "^0.6.12"
  },

You can either manually update all the packages, or you can use a tool for that as well. I recommend using npm-check-updates : https://www.npmjs.com/package/npm-check-updates.

Typing ncu shows me what packages need to be updated, and ncu -u will get the latests versions for each package.

After that, if you did it correctly, and if you did configure the new Angular2 RC5 NgModules correctly, your app should work just like before.

Hope this helps.

share|improve this answer
    
should I keep 0.2.0 or update to 0.3.0 about @angular/forms ?? 'in angular2 doc they are making 0.3.0 ' – khalil _diouri Aug 12 at 14:43
    
I guess it's always better to get to the latest version so you don't end up with different version of different packages, and it seems easier to manage as well. Did you find the solution by the way ? – Alex Beugnet Aug 12 at 14:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.