Angular 1.3.19 changed the behavior of ng-pattern , which violates u-mask.
Currently, the ng-pattern directive checks $viewValue instead of $modelValue - Link in the list of changes .
Command
Angular provided a custom directive that returns the previous behavior. This is a good problem to solve this problem.
You must add the pattern-model attribute to the fields when using both ui-mask and ng-pattern .
<input type="text" class="form-control input-sm" placeholder="hh:mm:ss" name="hhmmss" ng-model="data.hhmmss" ng-pattern="/^([0-2]|0[0-9]|1[0-9]|2[0-3]):?[0-5][0-9]:?[0-5][0-9]$/" ui-mask="99:99:99" pattern-model />
Directive code (add it to your code base):
.directive('patternModel', function patternModelOverwriteDirective() { return { restrict: 'A', require: '?ngModel', priority: 1, compile: function() { var regexp, patternExp; return { pre: function(scope, elm, attr, ctrl) { if (!ctrl) return; attr.$observe('pattern', function(regex) { if (angular.isString(regex) && regex.length > 0) { regex = new RegExp('^' + regex + '$'); } if (regex && !regex.test) {
Problem in ui-mask GitHub - Link .
source share