Skip to content

Commit

Permalink
Fix rule required #28
Browse files Browse the repository at this point in the history
  • Loading branch information
hueitan committed Jul 17, 2014
1 parent b9c1447 commit 5f06982
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion dist/angular-validation-rule.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
.config(['$validationProvider', function ($validationProvider) {

var expression = {
required: /^.+$/,
required: function (value) {
return !!value;
},
url: /((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)/,
email: /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/,
number: /^\d+$/
Expand Down
2 changes: 1 addition & 1 deletion dist/angular-validation-rule.min.js

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

4 changes: 3 additions & 1 deletion src/rule.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
.config(['$validationProvider', function ($validationProvider) {

var expression = {
required: /^.+$/,
required: function (value) {
return !!value;
},
url: /((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)/,
email: /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/,
number: /^\d+$/
Expand Down

0 comments on commit 5f06982

Please sign in to comment.