1angular.module('main.directives') 2 3 /** 4 * Form validation which checks whether 2 model values are the same. 5 */ 6 .directive('acMatch', function () { 7 return { 8 restrict: 'A', 9 scope: true, 10 require: 'ngModel', 11 link: function (scope, elem , attrs, control) { 12 var checker = function () { 13 14 //get the value of the first password 15 var e1 = scope.$eval(attrs.ngModel); 16 17 //get the value of the other password 18 var e2 = scope.$eval(attrs.acMatch); 19 return e1 === e2; 20 }; 21 scope.$watch(checker, function (n) { 22 23 //set the form control to valid if both 24 //passwords are the same, else invalid 25 control.$setValidity("match", n); 26 }); 27 } 28 }; 29 });
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.