我LandingComponent
在公共库中有一个组件。我的应用程序中的几乎所有其他模块都需要使用此组件。
文件结构(在/app
文件夹内):
/library
landing.component.ts
/module1
mod1.module.ts
mod11.component.ts
/module2
mod2.module.ts
mod21.component.ts
app.module.ts
mod11.component.ts摘录
@Component({
template: '<landing title="M1C1 title" desc="M1C1 description"></landing>';
})
export class Mod11Component {}
mod21.component.ts摘录
@Component({
template: '<landing title="M2C1 title" desc="M2C1 description"></landing>';
})
export class Mod11Component {}
我应该如何组织导入和声明/指令使它起作用?我应该为库组件创建模块,然后在其他模块中使用它吗?
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句