MCPcopy Create free account
hub / github.com/angular-app/angular-app / validateEqual

Function validateEqual

client/src/app/admin/users/validateEquals.js:12–20  ·  view source on GitHub ↗
(myValue, otherValue)

Source from the content-addressed store, hash-verified

10 link: function(scope, elm, attrs, ctrl) {
11
12 function validateEqual(myValue, otherValue) {
13 if (myValue === otherValue) {
14 ctrl.$setValidity('equal', true);
15 return myValue;
16 } else {
17 ctrl.$setValidity('equal', false);
18 return undefined;
19 }
20 }
21
22 scope.$watch(attrs.validateEquals, function(otherModelValue) {
23 ctrl.$setValidity('equal', ctrl.$viewValue === otherModelValue);

Callers 1

validateEquals.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected