请我是angularjs的新手。我试图从本地计算机上获取数据以填充页面。所以我得到了上述错误。以下是我的代码。
<!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= "http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
<body>
<div ng-app="myApp" ng-controller="customersCtrl">
<table>
<tr ng-repeat="x in names">
<td>{{ x.id }}</td>
<td>{{ x.menu_items }}</td>
</tr>
</table>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('customersCtrl', function($scope, $http) {
$http.get("http://localhost:8383/database/remote.php")
.success(function (response) {$scope.names = response.records;});
});
</script>
</body>
</html>
&#13;
拜托,请帮忙。非常感谢