Skip to content

Commit af0ad59

Browse files
committed
Some style fixes. #6
1 parent 493daf7 commit af0ad59

File tree

3 files changed

+19
-18
lines changed

3 files changed

+19
-18
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.idea
22
node_modules
33
bower_components
4+
test.sh

src/directives/validation.directive.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ angular.module('bootstrap.angular.validation').directive('bsValidation', [
9292
}
9393

9494
if (shouldValidateOnBlur) {
95-
var dewatcher = $scope.$watch(function () {
95+
var dewatcher = $scope.$watch(function() {
9696
return ngModelController.$touched;
9797
}, function(lostFocus) {
9898
if (lostFocus) {

src/services/validation.service.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,33 +32,33 @@ angular.module('bootstrap.angular.validation').factory('BsValidationService', ['
3232
var ngIncludedURLs = [];
3333

3434
var genericValidators = {
35-
digits: function (value) {
35+
digits: function(value) {
3636
return (/^\d+$/).test(value);
3737
},
38-
equalto: function (value, $scope, attr) {
38+
equalto: function(value, $scope, attr) {
3939
return value + '' === attr.equalto + '';
4040
},
41-
number: function (value) {
41+
number: function(value) {
4242
return (/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/).test(value);
4343
},
44-
min: function (value, $scope, attr) {
44+
min: function(value, $scope, attr) {
4545
return parseFloat(value) >= parseFloat(attr.min);
4646
},
47-
max: function (value, $scope, attr) {
47+
max: function(value, $scope, attr) {
4848
return parseFloat(value) <= parseFloat(attr.max);
4949
},
50-
length: function (value, $scope, attr) {
50+
length: function(value, $scope, attr) {
5151
return value.length === parseInt(attr.length);
5252
},
53-
strictemail: function (value) {
53+
strictemail: function(value) {
5454
return new RegExp(/^[_a-z0-9]+(\.[_a-z0-9]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/).test(value);
5555
}
5656
};
5757

5858
var selectors = [];
5959
var elements = ['input', 'select', 'textarea'];
6060

61-
angular.forEach(elements, function (element) {
61+
angular.forEach(elements, function(element) {
6262
selectors.push(element + '[ng-model]');
6363
selectors.push(element + '[data-ng-model]');
6464
});
@@ -70,13 +70,13 @@ angular.module('bootstrap.angular.validation').factory('BsValidationService', ['
7070
* Search all the input element inside the given DOM element and apply the 'bs-validation' directive so we
7171
* need not a add it for every form element.
7272
*/
73-
getValidators: function () {
73+
getValidators: function() {
7474
var builtIn = ['equalto', 'min', 'max', 'number', 'digits', 'length'];
7575
var additional = Object.keys(genericValidators);
7676
return builtIn.concat(additional);
7777
},
7878

79-
getMeta: function () {
79+
getMeta: function() {
8080
return ['matchName'];
8181
},
8282

@@ -90,7 +90,7 @@ angular.module('bootstrap.angular.validation').factory('BsValidationService', ['
9090
return metaInformation;
9191
},
9292

93-
addDirective: function ($element) {
93+
addDirective: function($element) {
9494
var validateableElements = $element.find(selector);
9595
validateableElements.attr('bs-validation', '');
9696
return validateableElements;
@@ -109,20 +109,20 @@ angular.module('bootstrap.angular.validation').factory('BsValidationService', ['
109109
}
110110
},
111111

112-
addToNgIncludedURLs: function (url) {
112+
addToNgIncludedURLs: function(url) {
113113
if (ngIncludedURLs.indexOf(url) === -1) {
114114
ngIncludedURLs.push(url);
115115
}
116116
},
117117

118-
addValidator: function ($scope, $attr, ngModelController, validatorKey) {
119-
ngModelController.$validators[validatorKey] = function (modelValue, viewValue) {
118+
addValidator: function($scope, $attr, ngModelController, validatorKey) {
119+
ngModelController.$validators[validatorKey] = function(modelValue, viewValue) {
120120
var value = modelValue || viewValue;
121121
return ngModelController.$isEmpty(value) || genericValidators[validatorKey](value, $scope, $attr);
122122
};
123123
},
124124

125-
checkNgIncludedURL: function (url) {
125+
checkNgIncludedURL: function(url) {
126126
var index = ngIncludedURLs.indexOf(url);
127127
if (index > -1) {
128128
ngIncludedURLs.splice(index, 1);
@@ -153,7 +153,7 @@ angular.module('bootstrap.angular.validation').factory('BsValidationService', ['
153153
return validationConfig.getDisplayErrorsAs();
154154
},
155155

156-
getDefaultMessage: function (key) {
156+
getDefaultMessage: function(key) {
157157
return messages[key];
158158
},
159159

@@ -202,7 +202,7 @@ angular.module('bootstrap.angular.validation').factory('BsValidationService', ['
202202
$formGroupElement.removeClass(validationConfig.successClass);
203203
},
204204

205-
resolveMessage: function ($element, $attr, key) {
205+
resolveMessage: function($element, $attr, key) {
206206
var metaInformation = this.getMetaInformation($element);
207207
var message = $element.attr(key + '-notification') || this.getDefaultMessage(key);
208208

0 commit comments

Comments
 (0)