0
我不知道是否有可能與角2在庫中創建自定義組件,並在app.component.ts
像這樣使用它:在Angular 2中,是否可以在其他組件中插入自定義組件?
app.component.ts
----------------
@Component({
selector: 'my-app',
template:`<comp-a>
<comp-b></comp-b>
<comp-b></comp-b>
<comp-b></comp-b>
</comp-a>'
我知道可以創建嵌套組件。這不是我的問題。在你的例子中,如果我明白了,在template屬性中的 direclty中。在我的情況下,我想在主文件中使用兩個組件,第一個包裝另一個,而不使用像 custom-component>這樣的屬性標記。 –