我正在尝试访问函数createLocalAccount中的变量email和密码,我该如何维护代码结构呢?
var createLocalAccount = function(response) {
return localDb.put('login', {
uid: response.uid,
email: email,
password: password
});
};
this.createAccount = function(firstName, lastName, email, password) {
var deferred = $q.defer();
createAccount(email, password)
.then(createLocalAccount);
return deferred.promise;
}
答案 0 :(得分:1)
将其传递给函数:
move-to