X Tutup
Skip to content

Feature Request: Pattern Validator #5411

@awiseman

Description

@awiseman

Hello Angular2 team,

I would like to request that support be added for form control validation based on the input's pattern attribute:

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-pattern

What I have in mind is similar to how the required attribute has a built-in validator, so an example use case is:

<input type="text" ng-control="test" pattern="[a-zA-Z ]*">

I believe this would be a useful general-case regular expression validator and this approach fits in with existing HTML5 semantics.

I have implemented this validator in my branch here

https://github.com/awiseman/angular/tree/pattern-validator

I believe that my branch is ready to be submitted as a pull request, but I am new to github, Angular2's development workflow and open source contributing in general, so I would appreciate some direction on what my appropriate next steps are. I've been following the guidelines in the CONTRIBUTiNG.md documentation and I've signed the CLA agreement, but I'm not sure whether this would be considered a minor or major feature change, since it involves adding a new public api.

Also, my branch's current commit has one failing unit test: public_api_spec.ts

I believe this just requires my new validator to be added to the api list, but the comment in the file said not to make any modifications without approval, so I didn't want to touch it yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup