Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

ng-pattern only work in angular 1.2.1, but not on 1.3.17, 1.4.3 and 1.4.4 #12618

Closed
@surielmx

Description

@surielmx

Hello, I have a problem, I trying to validate an input number, setting 00.00. what I need?, only two digits after and before decimal dot, no matter if the two digits after decimal dot are 00.

Between many patterns, I found this that it serves me:
/^\d{0,1}(\d.\d)?\d?$/

I created four examples on plunker with different versions of angularjs, that explain my problem and no matter if set pattern instead ng-pattern attribute, still not working.

Angularjs 1.4.4 http://plnkr.co/edit/K00ffy?p=preview
Angularjs 1.4.3 http://plnkr.co/edit/jCYj97?p=preview
Angularjs 1.3.17 http://plnkr.co/edit/93absW?p=preview
Angularjs 1.2.1 http://plnkr.co/edit/ooFneS?p=preview

The last one works, but my question or the question is, what it's wrong?, me or the versions of AngularJS?.

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions