Skip to content

Commit

Permalink
Merge pull request #62 from jembi/regex-validation-issue
Browse files Browse the repository at this point in the history
Regex validation error
  • Loading branch information
Martin Brocker authored Jun 26, 2019
2 parents a5a6506 + 7905c08 commit 0ae42a7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "md-form-builder",
"version": "0.14.6",
"version": "0.14.7",
"description": "AngularJS - Material Design - Form Builder",
"main": "src/index.js",
"browserify": {
Expand Down
3 changes: 3 additions & 0 deletions src/validators/regex.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ module.exports = function ($compile) {

if (regexValidation.apply) {
ngModel.$validators.regexValidation = function (modelValue) {
if (!modelValue) {
return true
}
return new RegExp(regexValidation.regexValidation.regex).test(modelValue)
}
ngModel.$validate()
Expand Down

0 comments on commit 0ae42a7

Please sign in to comment.