我現在有像這樣添加桌到桌行動態角2
<table class="table table-sm responsive" [mfData]="users" #mf="mfDataTable" [mfRowsOnPage]="10">
<thead>
<tr>
<th>
</th>
<th>
<mfDefaultSorter by="name">Name</mfDefaultSorter>
</th>
<th class="no-sort hidden-sm-down">
<mfDefaultSorter by="role">Roles</mfDefaultSorter>
</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let person of mf.data">
<td>
<div class="btn-group btn-group-sm" role="group" aria-label="Basic example">
<button type="button" class="btn btn-warning" (click)="open(person)">
<i class="fa fa-fw fa-edit"></i>
</button>
</td>
<td>
<h6>
<span>
<a href="mailto:{{person.email}}">
<i class="fa fa-envelope"></i>
</a>
</span>
{{person.firstName}} {{person.lastName}}
</h6>
</td>
<td>
<h6>{{person.role}}</h6>
</td>
</tr>
<tr *ngIf="(mf.data).length === 0">
<td colspan="100">No matches</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="12">
<mfBootstrapPaginator [rowsOnPageSet]="[5,10,15]"></mfBootstrapPaginator>
</td>
</tr>
</tfoot>
</table>
的Angular2-Datatable實現我希望能夠做的就是創建一個子表的時候開()手柄被激發。我之前在Angular JS中做過這個,但是很難弄清楚如何用Angular 2做到這一點。我是否需要創建一個新組件並使用jQuery將模板加載到行中?
你能告訴我們你的工作Angular JS的例子嗎? – yurzui
你想在這個模板中插入新表格?它應該遞歸工作(插入的表可以插入一個更多的內部本身等)? – Dimanoid