0
我想使用Ng-內容,它似乎不工作。完整的代碼在這裏plunker Full codeAngular 2 Ng-內容,它似乎不工作
@Component({
selector: 'my-app',
template: `
<div>
<h2>Hello {{name}}</h2>
<div>
Title:
<ng-content select=".my-component-title"></ng-content>
</div>
<div>
Content:
<ng-content select=".my-component-content"></ng-content>
</div>
</div>
`,
})
我已經更新了plunker碼現在NG-內容是不是在根組件。但它仍然沒有工作。
我有更新plunker代碼,現在NG-內容不是根 – balaG
但也沒有什麼配套的選擇。目前還不清楚你的問題是什麼。預期的行爲是什麼? –