[英]angular2 use component of nested imported module
is it possible to have the following strucure? 有没有可能有以下结构?
app.component.js app.component.js
@Component({
template: '<nav-context></nav-context>'
class AppComponent
app.module.js app.module.js
@NgModule({
imports: [CoreModule]
boostrap: [AppComponent]
core.module.js core.module.js
@NgModule({
imports: [NavModule]
class CoreModule
nav.module.js nav.module.js
@NgModule({
declarations: [NavContextComponent]
exports: [NavContextComponent]
class NavModule
nav-context.component.js NAV-context.component.js
@Component({
selector: 'nav-context'
class NavContextComponent
So far I get 'nav-context' is not a known element
到目前为止,我得到的
'nav-context' is not a known element
I think you need to also export the module if you want it to be provided to importers 如果您希望将模块提供给导入器,我认为您还需要导出模块
@NgModule({
imports: [NavModule]
exports: [NavModule]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.