수

AngularJS 테이블

· 2017-08-16 (수) 19:15:05 · 1588
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>
|
댓글을 작성하시려면 로그인이 필요합니다.

퍼블리싱강좌

302건
+
분류 제목 글쓴이 날짜 조회
AngularJS
[AngularJS]
17-08-24 조회 1,533
AngularJS
[AngularJS]
17-08-24 조회 1,852
AngularJS 17-08-24 조회 1,756
AngularJS 17-08-23 조회 1,800
AngularJS 17-08-23 조회 2,467
AngularJS 17-08-23 조회 1,686
AngularJS 17-08-22 조회 1,719
AngularJS 17-08-22 조회 1,833
AngularJS 17-08-22 조회 2,232
AngularJS 17-08-20 조회 2,343
AngularJS 17-08-20 조회 1,918
AngularJS 17-08-20 조회 1,551
AngularJS 17-08-18 조회 1,889
AngularJS 17-08-18 조회 2,187
AngularJS 17-08-18 조회 1,461
AngularJS 17-08-17 조회 2,423
AngularJS 17-08-17 조회 1,519
AngularJS 17-08-17 조회 1,571
AngularJS 17-08-16 조회 1,764
AngularJS 17-08-16 조회 1,589
AngularJS 17-08-16 조회 2,381
AngularJS 17-08-15 조회 1,895
AngularJS 17-08-15 조회 2,213
AngularJS 17-08-15 조회 1,554
AngularJS 17-08-11 조회 2,543
AngularJS 17-08-11 조회 2,554
AngularJS 17-08-11 조회 2,354
AngularJS 17-08-10 조회 1,666
AngularJS 17-08-10 조회 2,133
AngularJS 17-08-09 조회 2,261