0
$http({
url: "php/load.php",
method: "GET",
params: {'userId':userId}
}).success(function(data, status, headers, config) {
$scope.data = data;
}).error(function(data, status, headers, config) {
});
$scope.data[0]= "something";
如何在ajax之上等待以完成加載然後加載$ scope.data [0] =「something」;?我試圖把它內$ http和低於$ scope.data =數據,但它似乎有衝突仍然..ajax在異步模式下的回調衝突
爲什麼不在成功回調裏面做? –
-1不是一個真正的問題。 [**如何問**](http://stackoverflow.com/questions/how-to-ask) – mate64
簡單的答案:你不能。 –