コンポーネントで2回ng-contentを再利用する方法はありますか?または、コンポーネントコンストラクター内の変数に割り当てますか?
何かのようなもの:
@Component({
selector: "component"
})
@View({
template: `<ng-content></ng-content> and again <ng-content></ng-content>`
})
はい、私もこれを見つけました。
<my-component> <div content-a> A </div> </my-component>
およびコンポーネント内:
<ng-content select="[content-a]"></ng-content>
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加