Upgrade Angular 2 from RC.4 to RC.5

Angular 2 on upgrade from RC.4 to RC.5 marked as deprecated HTTP_PROVIDERS, added @NgModule and changed structure of root component.

If you get notice about any _PROVIDERS

In RC.4 it was:

bootstrap(AppComponent, [
  disableDeprecatedForms(),
  provideForms(),
  HTTP_PROVIDERS
]);

In RC.5 it looks like:

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    CommonModule,
    FormsModule,
    HttpModule
  ],
  providers: [],
  entryComponents: [AppComponent],
  bootstrap: [AppComponent]
})

As you can see all core providers was moved to imports.

No comments

Leave a comment!

Your email address will not be published. Required fields are marked *