-1
如何使用所获取的数据customersController
在AnotherCustomersController
混淆在控制器
function customersController($scope, $http) {
$http.get("http://www.w3schools.com//website/Customers_JSON.php")
.success(function(response) {$scope.names = response;});
}
function AnotherCustomersController($scope){
//What should I do here??
}
您需要张贴代码 – PSL 2014-09-05 20:28:17
请检查这个答案http://stackoverflow.com/a/12233991/1223357 抽象逻辑负责提取数据到可重用的服务。 – Teq1 2014-09-05 21:15:23