我不会在其他函数中处理承诺,但在第一个回调变量工作后不会改变。请帮我。在这里查看我的代码:
this.handlerLocalDef = function(defer) {
var hash = {};
defer.then(
function(response) {
hash = response;
},
function(err) {
showPopup(err);
}
);
return hash;
};
var initialized = function() {
var localRegDef = Localization.getLocalizedDefer('regularform'),
localPaymDef = Localization.getLocalizedDefer('payment');
localizeRegForm = self.handlerLocalDef(localRegDef, localizeRegForm);
$timeout(function() {
console.log("localizeRegForm", localizeRegForm);
},5000);
}();
控制台日志返回我 localizeRegForm: {}