Angular 2 can't find a component declared in my feature module
I guess you should export it like:
@NgModule({
imports:[CommonModule, FormsModule],
declarations: [PageHeaderComponent],
exports: [PageHeaderComponent]
})
export class AppCommonModule { }
This way other components could use the component.
Otherwise PageHeaderComponent
will only be available inside of AppCommonModule
See also
- https://angular.io/docs/ts/latest/guide/ngmodule.html#add-the-contactmodule
We export the ContactComponent so other modules that import the ContactModule can include it in their component templates.
All other declared contact classes are private by default
- https://angular.io/docs/ts/latest/cookbook/ngmodule-faq.html#!#q-what-to-export
Export declarable classes that components in other modules should be able to reference in their templates. These are your public classes. If you don't export a class, it stays private, visible only to other component declared in this module.