0
タグ間のコンポーネントを情報を伝承するためにどのように私は角度
<app-select-component><p>Hello world</p></app-select-component>
私はこの手法はと呼ばれ、それがGoogleに記述する苦労してどのように忘れてしまった
....のように
タグ間のコンポーネントを情報を伝承するためにどのように私は角度
<app-select-component><p>Hello world</p></app-select-component>
私はこの手法はと呼ばれ、それがGoogleに記述する苦労してどのように忘れてしまった
....のように
は角もしかして意味コンテンツ投影。はいの場合は、このようにしてください。
私-component.component.ts
import { Component } from '@angular/core';
@Component({
selector: 'my-component',
template: `
<div class="my-component">
<ng-content></ng-content>
</div>
`
})
export class MyComponent {}
app.component.ts
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
template: `
<div class="app">
<my-component>
This is my transcluded content!
</my-component>
</div>
`
})
export class AppComponent {}
DOM
<div class="app">
<my-component>
<div class="my-component">
This is my transcluded content!
</div>
</my-component>
</div>
それはAngularJSと角HTTPSで "コンテンツの投影" の "トランスクルー" と呼ばれています。 //toddmotto.com/transclusion-in-angular-2-with-ng-content – etiennecrb
ありがとうございました。私が必要としていたことです。あなたが望むなら、私は答えを承認することができます。 –