0
我保存了一些數據,我從API中獲得了正確的響應。之後,我試圖在我的。$ save函數結束後使用這些信息。這裏是我的代碼:
auxPostulation = new Postulation($scope.postulation);
auxPostulation.$save(null, function(response){
//I get the response and the id value without trouble.
$scope.postulation_id = response.id;
},function(error){
console.log('erro');
});
我想使用的呼叫之外的反應,但我不能達到它。總是得到'$ scope.postulation_id = undefined'。
這個函數的行爲如何?
謝謝您的高級。