87,990
社区成员
发帖
与我相关
我的任务
分享 function test (){
service.A(function(ALists){
if(ALists){
//进行处理
}
});
}
service = {
A:function(callback){
callback($scope.getALists)
}
}
service.A = function (callback) {
$.ajax({
url: "xxxxxxxxxxxxx",
type: "POST",
success: function (data) {
callback(data);
}
});
}
function test() {
service.A(function (data) {
$scope.getALists = data;
//所有后续处理都在这里进行
});
//这后面不要进行任何与获取的数据有关的操作
}
test();
//这后面也同样的不要进行任何与获取的数据有关的操作