AngularJS SQL - MySQL을 실행하는 PHP 서버에서 데이터 가져 오기

· 8년 전 · 1993
AngularJS SQL - MySQL을 실행하는 PHP 서버에서 데이터 가져 오기

<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_mysql.php")
.then(function (response) {$scope.names = response.data.records;});
});
</script>

<!DOCTYPE html>
<html >
<style>
table, th , td {
border: 1px solid grey;
border-collapse: collapse;
padding: 5px;
}
table tr:nth-child(odd) {
background-color: #f1f1f1;
}
table tr:nth-child(even) {
background-color: #ffffff;
}
</style>
<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_mysql.php")
.then(function (response) {$scope.names = response.data.records;});
});
</script>

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

퍼블리싱강좌

+
분류 제목 글쓴이 날짜 조회
AngularJS
[AngularJS]
8년 전 조회 1,511
AngularJS 8년 전 조회 1,527
AngularJS
[AngularJS]
8년 전 조회 1,573
AngularJS
[AngularJS]
8년 전 조회 1,611
AngularJS
[AngularJS]
8년 전 조회 1,607
AngularJS
[AngularJS]
8년 전 조회 1,150
AngularJS
[AngularJS]
8년 전 조회 1,504
AngularJS 8년 전 조회 1,418
AngularJS 8년 전 조회 1,377
AngularJS 8년 전 조회 1,550
AngularJS 8년 전 조회 1,338
AngularJS 8년 전 조회 1,389
AngularJS 8년 전 조회 1,501
AngularJS 8년 전 조회 1,260
AngularJS 8년 전 조회 1,994
AngularJS 8년 전 조회 1,569
AngularJS 8년 전 조회 1,219
AngularJS 8년 전 조회 1,529
AngularJS 8년 전 조회 1,307
AngularJS 8년 전 조회 1,118
AngularJS 8년 전 조회 2,090
AngularJS 8년 전 조회 1,167
AngularJS 8년 전 조회 1,227
AngularJS 8년 전 조회 1,419
AngularJS 8년 전 조회 1,273
AngularJS 8년 전 조회 1,466
AngularJS 8년 전 조회 1,475
AngularJS 8년 전 조회 1,248
AngularJS 8년 전 조회 1,217
AngularJS 8년 전 조회 1,619