Loosen validator directives selectors · Issue #51248 · angular/angular · GitHub
Skip to content

Loosen validator directives selectors #51248

Description

@Xriuk

Which @angular/* package(s) are relevant/related to the feature request?

forms

Description

I have created few custom input components which are basically wrappers around other controls, and they could use validators like [min], [max], ... but I noticed that the selectors for MaxValidator are input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel] and this prohibits the usage on external components.

Proposed solution

Changing specific selectors to just [max][formControlName],[max][formControl],[max][ngModel] would allow using them everywhere. I have created a custom directive inheriting from the original directive and it works straight out of the box.

Alternatives considered

None

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions