136
rated 0 times
[
139]
[
3]
/ answers: 1 / hits: 12256
/ 10 Years ago, tue, april 8, 2014, 12:00:00
I am trying to use below date (mm/dd/yyyy) validation pattern using ng-pattern in view.
ng-pattern=/^(d{4})-(d{2})-(d{2})$/
As soon as I start typing the date the validation error appears and stays even after having valid date such as 10/15/1988
I tried passing it through controller using var (as shown below) but behaves the same:
In Controller:
$scope.myPattern = /^(d{4})-(d{2})-(d{2})$/;
In View:
ng-pattern={{myPattern}}
Note: This both approach not working only in IE9
More From » regex