cmsmon
Version:
34 lines (33 loc) • 1.21 kB
HTML
<table class="table cms-admin-table cms-table-section">
<thead>
<tr>
<th ng-repeat="col in to.fields track by $index"
ng-style="{width:to.widths ? to.widths.split(' ')[$index] + '%':'initial'}">{{col.templateOptions.label}}
</th>
<th>X</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="element in model[options.key] track by $index"
ng-init="_index = $index;_formState = createFormState($index)">
<td ng-repeat="field in to.fields"
ng-init="_field = copyItemOptions(field)">
<formly-field options="_field"
model="model[options.key][_index]"
form="form"
form-state="_formState">
</formly-field>
</td>
<td>
<button type="button" class="btn btn-xs btn-white"
tabIndex="-1"
ng-click="model[options.key].splice(_index, 1)">
<i class="fa fa-trash-o"></i>
</button>
</td>
</tr>
</tbody>
</table>
<button type="button" class="btn btn-white btn-xs"
ng-click="addNew()" style="z-index: 1;">{{to.btnText}}
</button>