Angular ng-Pattern - 1 or 2 numbers

Asked

Viewed 213 times

1

In the code below I need to make ng-Pattern receive 1 or two numbers, and the format is in media, that is, minimum node 0 or 00 and maximum 59.

<input type="text" step="any" value="" ng-model="job.ValorIntervalo" min="0" max="60" ng-pattern="/^([0-9]{1}[0-9]{1}$/">

1 answer

3


For this your validation just put the regular expression below:

^([0-5]{1}\d{1})$|^(\d{1})$

You can perform the tests here

  • Felipe, excellent!! It worked perfectly, a hug!

  • 2

    If the answer was helpful do not forget to mark as answered, so that it comes to help other people who have the same problem. Hug

Browser other questions tagged

You are not signed in. Login or sign up in order to post.