From 12b6deb1ce99df64e2fc91a06bf05cd7f4a3a475 Mon Sep 17 00:00:00 2001 From: austingreco Date: Fri, 29 Mar 2013 23:45:53 -0500 Subject: fix(ngPattern): allow modifiers on inline ng-pattern Add support for regex modifiers on inline `ng-pattern`. `ng-pattern="/regex/i"` now validates correctly. Closes #1437 --- test/ng/directive/inputSpec.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test') diff --git a/test/ng/directive/inputSpec.js b/test/ng/directive/inputSpec.js index 4dcb79a3..d69be27c 100644 --- a/test/ng/directive/inputSpec.js +++ b/test/ng/directive/inputSpec.js @@ -476,6 +476,18 @@ describe('input', function() { }); + it('should validate in-lined pattern with modifiers', function() { + compileInput(''); + scope.$digest(); + + changeInputValueTo('aB'); + expect(inputElm).toBeValid(); + + changeInputValueTo('xx'); + expect(inputElm).toBeInvalid(); + }); + + it('should validate pattern from scope', function() { compileInput(''); scope.regexp = /^\d\d\d-\d\d-\d\d\d\d$/; -- cgit v1.2.3