0
共通のライブラリにコンポーネントLandingComponent
があります。このコンポーネントは、アプリケーションのほとんどの他のモジュールで使用する必要があります。 (/app
フォルダ内)角2 RC5 - 異なるモジュールで使用される共通コンポーネント
ファイル構造:
/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 {}
輸入と宣言/指令をどのように整理して機能させるべきですか? ライブラリコンポーネント用のモジュールを作成し、それを他のモジュールで使用する必要がありますか?