AngularJS 테이블

· 8년 전 · 1274
AngularJS 테이블

ng-repeat 지시어는 테이블을 표시하는 데 적합합니다.

테이블에 데이터 표시
각도가있는 표를 표시하는 것은 매우 간단합니다.


<div ng-app="myApp" ng-controller="customersCtrl">

<table>
<tr ng-repeat="x in names">
<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("customers.php")
.then(function (response) {$scope.names = response.data.records;});
});
</script>


[전체소스]
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<body>

<div ng-app="myApp" ng-controller="customersCtrl">

<table>
<tr ng-repeat="x in names">
<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("customers.php")
.then(function (response) {$scope.names = response.data.records;});
});
</script>

</body>
</html>
|
댓글을 작성하시려면 로그인이 필요합니다.

퍼블리싱강좌

+
분류 제목 글쓴이 날짜 조회
AngularJS 8년 전 조회 1,341
AngularJS 8년 전 조회 1,395
AngularJS 8년 전 조회 1,505
AngularJS 8년 전 조회 1,261
AngularJS 8년 전 조회 1,998
AngularJS 8년 전 조회 1,571
AngularJS 8년 전 조회 1,223
AngularJS 8년 전 조회 1,533
AngularJS 8년 전 조회 1,309
AngularJS 8년 전 조회 1,120
AngularJS 8년 전 조회 2,092
AngularJS 8년 전 조회 1,168
AngularJS 8년 전 조회 1,231
AngularJS 8년 전 조회 1,424
AngularJS 8년 전 조회 1,275
AngularJS 8년 전 조회 1,466
AngularJS 8년 전 조회 1,480
AngularJS 8년 전 조회 1,250
AngularJS 8년 전 조회 1,218
AngularJS 8년 전 조회 1,619
AngularJS 8년 전 조회 1,603
AngularJS 8년 전 조회 1,446
AngularJS 8년 전 조회 1,320
AngularJS 8년 전 조회 1,758
AngularJS 8년 전 조회 1,208
AngularJS 8년 전 조회 1,611
AngularJS 8년 전 조회 1,539
AngularJS 8년 전 조회 1,238
AngularJS 8년 전 조회 1,778
AngularJS 8년 전 조회 1,803