Hi, straight to the point:
I use Angular-cli v. 1.0.0
There is a main module:
@NgModule({ imports: [ CommonModule, BrowserModule, DashboardModule, ..... another modules ..... ], declarations: [ AppComponent, HeaderComponent, BeautyPriceDirective ], bootstrap: [AppComponent] }) export class AppModule {} It connects BeautyPriceDirective, the usual such attribute directive.
And there is a second module that is imported into the main (AppModule):
@NgModule({ imports: [ CommonModule, BrowserModule ], declarations: [ DashboardComponent, DashboardTilesComponent, ], }) export class DashboardModule { } The problem is that the directive does not work in the DashboardComponent component and in all the nested ones, but it works quietly for itself in the HeaderComponent, which is declared in the first module.
Also, if you declare DashboardComponent in the first module, then the directive in it works perfectly.
Most likely there is some not at all tricky way to "forward" directives and other data into the imported module ... or is it still not, and you need to make a huge list of components like this?
PS when I try to place a known directive in an imported module - Angular swears that this announcement is already indicated in two modules.
exports: [BeautyPriceDirective]section in AppModuleexports: [BeautyPriceDirective]- Grundy