i\'m upgrading my Angular 2 project from RC5 to 2.0.0. I get this Error
Unhandled Promise rejection: Component LoginComponent is not part of any NgM
Make it sure that your component is imported in app.module.ts. In my case that it was the reason where I forgot to include the component in the declaration
@NgModule({
declarations: [
AppComponent,
HomeComponent,
IndexComponent
],
imports: [
BrowserModule, FormsModule, HttpClientModule, RouterModule.forRoot(routes)
],
exports: [RouterModule],
providers: [],
bootstrap: [AppComponent]
})
Also make sure you restart server when new modules and components are added while ng serve it is also a reaosn when this problem occur. So, the basic solution is to quit the server and ng serve again.