add validation to wallet secret
This commit is contained in:
parent
eedfdcfaa1
commit
9d5f2ddf16
4 changed files with 29 additions and 7 deletions
|
|
@ -64,6 +64,21 @@ angular.module('copay.directives')
|
|||
};
|
||||
}
|
||||
])
|
||||
.directive('walletSecret', ['walletFactory',
|
||||
function(walletFactory) {
|
||||
return {
|
||||
require: 'ngModel',
|
||||
link: function(scope, elem, attrs, ctrl) {
|
||||
var validator = function(value) {
|
||||
ctrl.$setValidity('walletSecret', Boolean(walletFactory.decodeSecret(value)));
|
||||
return value;
|
||||
};
|
||||
|
||||
ctrl.$parsers.unshift(validator);
|
||||
}
|
||||
};
|
||||
}
|
||||
])
|
||||
.directive('loading', function() {
|
||||
return {
|
||||
restrict: 'A',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue