add makePinInput
This commit is contained in:
parent
d3128137ce
commit
3627671307
3 changed files with 46 additions and 64 deletions
|
|
@ -48,5 +48,24 @@ angular.module('copayApp.services')
|
|||
ls.removeItem(KEY, cb);
|
||||
};
|
||||
|
||||
|
||||
root.makePinInput = function(scope, name, cb) {
|
||||
Object.defineProperty(scope, name, {
|
||||
get: function() {
|
||||
return this['_' + name];
|
||||
},
|
||||
set: function(newValue) {
|
||||
this['_' + name] = newValue;
|
||||
scope.error = null;
|
||||
if (newValue && newValue.length == 4) {
|
||||
return cb(newValue);
|
||||
}
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
return root;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue