Sha256: 93b8c053ea76ec5c86c5063b52c55b8209332e2f1551695d0ce7716a853dadb0
Contents?: true
Size: 1.03 KB
Versions: 7
Compression:
Stored size: 1.03 KB
Contents
/** * angular-input-match * ngModel validation for matching model attributes * @version v0.0.1-dev-2014-04-19 * @link https://github.com/interval-braining/angular-input-match * @license MIT License, http://www.opensource.org/licenses/MIT */ if (typeof module !== "undefined" && typeof exports !== "undefined" && module.exports === exports){ module.exports = 'directives.inputMatch'; } (function (window, angular, undefined) { "use strict"; // Source: src/angular_input_match.js var inputMatch = angular.module('directives.inputMatch', []); inputMatch.directive('match', function () { function link(scope, elem, attrs, ctrl) { if(!ctrl) { return; } scope.$watch( function() { return (ctrl.$pristine && angular.isUndefined(ctrl.$modelValue)) || scope.match === ctrl.$modelValue; }, function(currentValue) { ctrl.$setValidity('match', currentValue); } ); } return { link: link, require: '?ngModel', restrict: 'A', scope: { match: '=' } }; }); })(window, window.angular);
Version data entries
7 entries across 7 versions & 1 rubygems