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

· 8년 전 · 1899
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,387
AngularJS 8년 전 조회 1,414
AngularJS
[AngularJS]
8년 전 조회 1,463
AngularJS
[AngularJS]
8년 전 조회 1,508
AngularJS
[AngularJS]
8년 전 조회 1,496
AngularJS
[AngularJS]
8년 전 조회 1,036
AngularJS
[AngularJS]
8년 전 조회 1,414
AngularJS 8년 전 조회 1,306
AngularJS 8년 전 조회 1,282
AngularJS 8년 전 조회 1,455
AngularJS 8년 전 조회 1,229
AngularJS 8년 전 조회 1,290
AngularJS 8년 전 조회 1,390
AngularJS 8년 전 조회 1,157
AngularJS 8년 전 조회 1,900
AngularJS 8년 전 조회 1,454
AngularJS 8년 전 조회 1,137
AngularJS 8년 전 조회 1,406
AngularJS 8년 전 조회 1,201
AngularJS 8년 전 조회 1,017
AngularJS 8년 전 조회 1,983
AngularJS 8년 전 조회 1,055
AngularJS 8년 전 조회 1,116
AngularJS 8년 전 조회 1,309
AngularJS 8년 전 조회 1,149
AngularJS 8년 전 조회 1,367
AngularJS 8년 전 조회 1,374
AngularJS 8년 전 조회 1,135
AngularJS 8년 전 조회 1,097
AngularJS 8년 전 조회 1,513
🐛 버그신고