今天在做angular项目的时候,发现想加一个功能,怎么都加不上去,最后发现是把把then当成同步函数去写了,then是异步,要链式操作代替嵌套!
TBInterface.del_game(game_name)
.then(function(result){
layer.alert(result);
},function(err){
layer.alert("删除失败,请联系junhuanie");
}).then(function(){
$('#dialog2').dialog("close");
.then(function(result){
layer.alert(result);
},function(err){
layer.alert("删除失败,请联系junhuanie");
}).then(function(){
$('#dialog2').dialog("close");
浙公网安备 33010602011771号