Now I need to access some value which from promise.but it return undefined. Do I have to do it inside promise.then(function(){})? Here is my code:
var promise = PCservice.loadPersonalCCList();
promise.then(function(data){
$scope.personalccinfor = data.CCMSGSRSV1.PERSONALCARDLISTRS.PERSONALCCLISTINFO.PERSONALCCLIST;
$scope.cardinfo = data.SIGNONMSGSRSV1.SONRS.PROFILE;
console.log($scope.cardinfo.COMPANYCODE);
});
console.log($scope.cardinfo.COMPANYCODE);
As you can see, I can access the code inside, but I need to make another ajax call which needs this data.The first console gives me what I want, but the second gives me undefined