Skip to content

Loosen validator directives selectors #51248

@Xriuk

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

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions