Skip to content

Commit 9eff351

Browse files
committed
chore(release): 1.6.0
1 parent 89e61ee commit 9eff351

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-validation-match",
3-
"version": "1.5.2",
3+
"version": "1.6.0",
44
"homepage": "https://github.com/TheSharpieOne/angular-validation-match",
55
"authors": [
66
"TheSharpieOne <[email protected]>"

dist/angular-validation-match.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*!
22
* angular-validation-match
33
* Checks if one input matches another
4-
* @version v1.5.1
4+
* @version v1.6.0
55
* @link https://github.com/TheSharpieOne/angular-validation-match
66
* @license MIT License, http://www.opensource.org/licenses/MIT
77
*/
@@ -25,17 +25,24 @@ function match ($parse) {
2525

2626
var matchGetter = $parse(attrs.match);
2727
var caselessGetter = $parse(attrs.matchCaseless);
28+
var noMatchGetter = $parse(attrs.notMatch);
2829

2930
scope.$watch(getMatchValue, function(){
3031
ctrl.$$parseAndValidate();
3132
});
3233

3334
ctrl.$validators.match = function(){
3435
var match = getMatchValue();
35-
if(caselessGetter(scope) && angular.isString(match) && angular.isString(ctrl.$viewValue)){
36-
return ctrl.$viewValue.toLowerCase() === match.toLowerCase();
36+
var notMatch = noMatchGetter(scope);
37+
var value;
38+
39+
if(caselessGetter(scope)){
40+
value = angular.lowercase(ctrl.$viewValue) === angular.lowercase(match);
41+
}else{
42+
value = ctrl.$viewValue === match;
3743
}
38-
return ctrl.$viewValue === match;
44+
value ^= notMatch;
45+
return !!value;
3946
};
4047

4148
function getMatchValue(){
@@ -49,4 +56,4 @@ function match ($parse) {
4956
};
5057
}
5158
match.$inject = ["$parse"];
52-
})(window, window.angular);
59+
})(window, window.angular);

dist/angular-validation-match.min.js

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-validation-match",
3-
"version": "1.5.2",
3+
"version": "1.6.0",
44
"homepage": "https://github.com/TheSharpieOne/angular-validation-match",
55
"description": "Checks if one input matches another",
66
"main": "./index.js",

0 commit comments

Comments
 (0)