initial import for Open Source 🎉
This commit is contained in:
parent
1898c361f3
commit
9c0dd3b722
2048 changed files with 218743 additions and 0 deletions
16
static/js/directives/match.js
Normal file
16
static/js/directives/match.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
/**
|
||||
* Adds a 'match' attribute that ensures that a form field's value matches another field's
|
||||
* value.
|
||||
*/
|
||||
angular.module('quay').directive('match', function($parse) {
|
||||
return {
|
||||
require: 'ngModel',
|
||||
link: function(scope, elem, attrs, ctrl) {
|
||||
scope.$watch(function() {
|
||||
return $parse(attrs.match)(scope) === ctrl.$modelValue;
|
||||
}, function(currentValue) {
|
||||
ctrl.$setValidity('mismatch', currentValue);
|
||||
});
|
||||
}
|
||||
};
|
||||
});
|
Reference in a new issue