我们可以将之前章节中的代码用来从数据库中读取数据。通过PHP Server从MySQL数据库中获取数据<div ng-app="myApp" ng-controller="customersCtrl"> <table> ...
我们可以将之前章节中的代码用来从数据库中读取数据。
通过PHP Server从MySQL数据库中获取数据
<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("http://customers_mysql.php") .success(function (response) {$scope.names = response.records;});});</script>
原标题:AngularJS快速入门指南09:SQL
关键词:JS
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。