aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/widget/input.js2
-rw-r--r--test/widget/inputSpec.js4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/widget/input.js b/src/widget/input.js
index a530b6a8..0defd234 100644
--- a/src/widget/input.js
+++ b/src/widget/input.js
@@ -732,7 +732,7 @@ angularWidget('input', function(inputElement){
patternMatch = valueFn(true);
} else {
if (pattern.match(/^\/(.*)\/$/)) {
- pattern = new RegExp(pattern.substring(1, pattern.length - 2));
+ pattern = new RegExp(pattern.substr(1, pattern.length - 2));
patternMatch = function(value) {
return pattern.test(value);
}
diff --git a/test/widget/inputSpec.js b/test/widget/inputSpec.js
index 6524f1e3..c73d5fdd 100644
--- a/test/widget/inputSpec.js
+++ b/test/widget/inputSpec.js
@@ -536,9 +536,9 @@ describe('widget: input', function() {
{min:0, max:1});
- itShouldVerify('text with inlined pattern contraint',
+ itShouldVerify('text with inlined pattern constraint',
['', '000-00-0000', '123-45-6789'],
- ['x000-00-0000x', 'x'],
+ ['x000-00-0000x', 'x000-00-0000', '000-00-0000x', 'x'],
{'ng:pattern':'/^\\d\\d\\d-\\d\\d-\\d\\d\\d\\d$/'});