У меня будет результат поиска, как показано ниже:
используя табличный тег и AngularJS, как показано ниже:
<tbody>
<tr ng-repeat="customer in fndCtrl.result">
<td>
1
</td>
<td ng-bind=":customer.CustomerNumber"></td>
<td ng-bind=":customer.FirstName + ' ' + customer.LastName"></td>
как я могу установить строку numbe? Я установил 1 для изображения, выше.
Добавьте track by $index
в ng-repeat. Модифицированный код
<tbody>
<tr ng-repeat="customer in fndCtrl.result track by $index">
<td>
{{ $index + 1 }}
</td>
<td ng-bind=":customer.CustomerNumber"></td>
<td ng-bind=":customer.FirstName + ' ' + customer.LastName"> </td>
Сделайте так:
<tbody>
<tr ng-repeat="customer in fndCtrl.result">
<td>
{{$index+1}}
</td>
<td ng-bind=":customer.CustomerNumber"></td>
<td ng-bind=":customer.FirstName + ' ' + customer.LastName"></td>