【发布时间】:2019-03-02 01:17:50
【问题描述】:
我在弄清楚如何将导入的模块中的组件传递到我的 Angular 应用程序中并在我也在我的应用程序中导入的另一个模块中使用它时遇到了问题。
请注意,所有这两个模块都是我创建的模块。
那是我的 app.module.ts :
@NgModule({
declarations: [
AppComponent,
HomeComponent,
PnDashboardComponent,
PnFormulaireComponent
],
imports: [
BrowserModule,
AppRoutingModule,
HttpClientModule,
LayoutModule.forRoot(environment.layout),
DispoModule.forRoot(environment.dispoAides)
],
providers: [
ErrorsHandler,
InitialisationService,
InitializationGuard
],
bootstrap: [AppComponent]
})
我想要做的是将一个名为 BreadcrumbComponent 的组件从 LayoutModule 传递到 DispoModule 并能够在该模块中使用它。
请注意,LayoutModule 和 DispoModule 是依赖 Angular 模块项目,它们使用 ng-packagr 打包并导入到我的应用程序中。
谢谢。
【问题讨论】:
-
查看出口答案,这是您要走的路。
-
@Swoox 它不起作用,我在 cmets 中解释了原因
标签: angular module components ng-modules