forked from kalpanas/ng-match
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathng-match.min.js
6 lines (6 loc) · 1.16 KB
/
ng-match.min.js
1
2
3
4
5
6
/*! ng-match - v 0.0.3 - Fri Mar 14 2014 13:40:57 GMT+0800 (CST)
* https://github.com/tomchentw/ng-match
* Copyright (c) 2014 [tomchentw](https://github.com/tomchentw);
* Licensed [MIT](http://tomchentw.mit-license.org)
*/
(function(){angular.module("ng-match",[]).value("ngMatchConfig",{delay:200}).controller("NgMatchCtrl",function(){function t(t,n,a,h){this.$timeout=t,this.ngMatchConfig=n,this.$scope=a,this.$attrs=h,this.promise=this.isMatch=void 0,this.setValidity=i(this,this.setValidity),a.$watch(function(){return a.$eval(h.ngModel)===a.$eval(h.ngMatch)},angular.bind(this,this.matchChanged))}var i,n=t.prototype;return i=angular.bind,n.matchChanged=function(t){this.isMatch=t,this.promise&&this.$timeout.cancel(this.promise),this.promise=this.$timeout(this.setValidity,this.$attrs.ngMatchDelay||this.ngMatchConfig.delay)},n.setValidity=function(){this.ngModelCtrl.$setValidity("match",this.isMatch),this.promise=void 0},t.$inject=["$timeout","ngMatchConfig","$scope","$attrs"],t}()).directive("ngMatch",function(){return{restrict:"A",require:["ngModel","ngMatch"],controller:"NgMatchCtrl",link:function(){var t,i,n;t=arguments[3],i=t[0],n=t[1],n.ngModelCtrl=i}}})}).call(this);