pip-webui
Version:
HTML5 UI for LOB applications
35 lines (27 loc) • 934 B
JavaScript
/**
* @file Checking uniqueness of email in input control
* @description
* Email validation is performed on server via /api/signup_validate REST operation
* @copyright Digital Living Software Corp. 2014-2016
*/
/* global angular */
(function () {
'use strict';
var thisModule = angular.module('pipPasswordMatch', []);
thisModule.directive('compareTo',function() {
return {
require: "ngModel",
scope: {
otherModelValue: "=compareTo"
},
link: function(scope, element, attributes, ngModel) {
ngModel.$validators.compareTo = function(modelValue) {
return modelValue == scope.otherModelValue;
};
scope.$watch("otherModelValue", function() {
ngModel.$validate();
});
}
};
});
})();