0
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<body>
<div ng-app="myApp" ng-controller="customersCtrl">
<table>
<tr>
<th></th>
<th>Name</th>
<th>Country</th>
</tr>
<tr ng-repeat="x in names">
<td>{{$index+1}}</td>
<td>{{ x.Name }}</td>
<td>{{ x.Country }}</td>
</tr>
</table>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('customersCtrl', function($scope, $http) {
$http.get("http://www.w3schools.com/angular/customers.php")
.then(function (response) {$scope.names = response.data.records;});
});
</script>
</body>
</html>
Хай Guys,Как повторить таблицу описание заголовка на каждые 2 записей
Я использую нг-повтор для отображения записей таблицы и $ индекса + 1, чтобы отобразить серийный номер.
Я хочу отображать заголовок и страну для повторения на каждые 2 записи (если $ index% 2 == 0). Как я это сделаю? Любая идея, пожалуйста.