Skip to content

Commit

Permalink
Merge pull request #180 from bvaughn/mininum-maximum-rule-zero
Browse files Browse the repository at this point in the history
Minimum/maximum rule fix when 0
  • Loading branch information
bvaughn committed Dec 13, 2015
2 parents daaed31 + 9eb764b commit 7885870
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
36 changes: 18 additions & 18 deletions dist/form-for.js
Original file line number Diff line number Diff line change
Expand Up @@ -2343,6 +2343,22 @@ var formFor;
;
})(formFor || (formFor = {}));
;
var formFor;
(function (formFor) {
/**
* Wrapper object for a form-field attribute that exposes field-state to field directives.
*
* <p>Note that this interface exists for type-checking only; nothing actually implements this interface.
*/
var BindableFieldWrapper = (function () {
function BindableFieldWrapper() {
}
return BindableFieldWrapper;
})();
formFor.BindableFieldWrapper = BindableFieldWrapper;
;
})(formFor || (formFor = {}));
;
/// <reference path="../../definitions/angular.d.ts" />
/// <reference path="form-for-configuration.ts" />
/// <reference path="../utils/nested-object-helper.ts" />
Expand Down Expand Up @@ -2638,7 +2654,7 @@ var formFor;
return null;
};
ModelValidator.prototype.validateFieldMaximum_ = function (value, validationRules) {
if (validationRules.maximum) {
if (validationRules.maximum || validationRules.maximum === 0) {
var stringValue = value.toString();
var numericValue = Number(value);
var maximum = angular.isObject(validationRules.maximum)
Expand Down Expand Up @@ -2680,7 +2696,7 @@ var formFor;
return null;
};
ModelValidator.prototype.validateFieldMinimum_ = function (value, validationRules) {
if (validationRules.minimum) {
if (validationRules.minimum || validationRules.minimum === 0) {
var stringValue = value.toString();
var numericValue = Number(value);
var minimum = angular.isObject(validationRules.minimum)
Expand Down Expand Up @@ -2916,20 +2932,4 @@ var formFor;
})();
formFor.StringUtil = StringUtil;
})(formFor || (formFor = {}));
var formFor;
(function (formFor) {
/**
* Wrapper object for a form-field attribute that exposes field-state to field directives.
*
* <p>Note that this interface exists for type-checking only; nothing actually implements this interface.
*/
var BindableFieldWrapper = (function () {
function BindableFieldWrapper() {
}
return BindableFieldWrapper;
})();
formFor.BindableFieldWrapper = BindableFieldWrapper;
;
})(formFor || (formFor = {}));
;
/// <reference path="../../../definitions/angular.d.ts" />
4 changes: 2 additions & 2 deletions dist/form-for.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/form-for.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions source/services/model-validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ module formFor {
}

private validateFieldMaximum_(value:any, validationRules:ValidationRules):any {
if (validationRules.maximum) {
if (validationRules.maximum || validationRules.maximum === 0) {
var stringValue:string = value.toString();
var numericValue:number = Number(value);

Expand Down Expand Up @@ -418,7 +418,7 @@ module formFor {
}

private validateFieldMinimum_(value:any, validationRules:ValidationRules):any {
if (validationRules.minimum) {
if (validationRules.minimum || validationRules.minimum === 0) {
var stringValue:string = value.toString();
var numericValue:number = Number(value);

Expand Down

0 comments on commit 7885870

Please sign in to comment.