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
Same issue here and i solved it.
1) You create your component
import { Component } from '@angular/core';
@Component({
moduleId:module.id,
selector: 'page-home',
templateUrl:'HomeComponent.html',
})
export class HomeComponent { }
2) You should declare it in app.module.ts
import {HomeComponent} from './Components/Pages/Home/HomeComponent';
...
declarations: [
AppComponent,
HomeComponent
],
And the problem is fixed.
The mentioned error is produced when you do not include associated components in main "module" section of the respective component. So ensure that the component is mentioned there in module.
In my case, I was using angular material dialog. I have forgot to include the dialog in NgModule. Dialog need to be there in both NgModule and entryComponents.