I need to do an equivalent of this in Angular2:
<?php
foreach ($somethings as $something) {
foreach ($something->children as $child) {
echo '<tr>...</tr>';
}
}
Can this be achieved with ngFor and not adding new elements between <table>
and <tr>
?
I have a sample that might be similar to what you want:
<table id="spreadsheet">
<tr *ngFor="let row of visibleRows">
<td class="row-number-column">{{row.rowIndex}}</td>
<td *ngFor="let col of row.columns">
<input data-id="{{col.rowIndex}}-{{col.columnIndex}}" [value]="col.cellValue" (input)="col.cellValue = $event.target.value" (click)="model.selectColumn(col)" (keyup)="navigate($event)" />
</td>
</tr>
</table>
I use this to render out a spreadsheet looking grid as seen here: http://www.syntaxsuccess.com/angular-2-samples/#/demo/spreadsheet