Skip to content

Commit

Permalink
chore(release): 1.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSharpieOne committed Sep 11, 2015
1 parent 89e61ee commit 9eff351
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-validation-match",
"version": "1.5.2",
"version": "1.6.0",
"homepage": "https://github.com/TheSharpieOne/angular-validation-match",
"authors": [
"TheSharpieOne <evan@lostonia.com>"
Expand Down
17 changes: 12 additions & 5 deletions dist/angular-validation-match.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* angular-validation-match
* Checks if one input matches another
* @version v1.5.1
* @version v1.6.0
* @link https://github.com/TheSharpieOne/angular-validation-match
* @license MIT License, http://www.opensource.org/licenses/MIT
*/
Expand All @@ -25,17 +25,24 @@ function match ($parse) {

var matchGetter = $parse(attrs.match);
var caselessGetter = $parse(attrs.matchCaseless);
var noMatchGetter = $parse(attrs.notMatch);

scope.$watch(getMatchValue, function(){
ctrl.$$parseAndValidate();
});

ctrl.$validators.match = function(){
var match = getMatchValue();
if(caselessGetter(scope) && angular.isString(match) && angular.isString(ctrl.$viewValue)){
return ctrl.$viewValue.toLowerCase() === match.toLowerCase();
var notMatch = noMatchGetter(scope);
var value;

if(caselessGetter(scope)){
value = angular.lowercase(ctrl.$viewValue) === angular.lowercase(match);
}else{
value = ctrl.$viewValue === match;
}
return ctrl.$viewValue === match;
value ^= notMatch;
return !!value;
};

function getMatchValue(){
Expand All @@ -49,4 +56,4 @@ function match ($parse) {
};
}
match.$inject = ["$parse"];
})(window, window.angular);
})(window, window.angular);
5 changes: 3 additions & 2 deletions dist/angular-validation-match.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-validation-match",
"version": "1.5.2",
"version": "1.6.0",
"homepage": "https://github.com/TheSharpieOne/angular-validation-match",
"description": "Checks if one input matches another",
"main": "./index.js",
Expand Down

0 comments on commit 9eff351

Please sign in to comment.