利用$q.all实现$http请求数据的顺序拼接,避免$http嵌套
$q GET {{data}} var myapp=angular.module("myApp",[]); myapp.controller("ctrl",["$scope","$http","$q",function ($scope,$http,$q) { $scope.getData=function () { var first=$q.defer(); var firstPromise=first.promise; $http.get('1.json').then( function (response) { first.resolve(response.data); },func...