Skip to content

Forms should accept Set collections in addition to arrays #46101

@jeripeierSBB

Description

@jeripeierSBB

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

forms

Description

Currently, using Validators.required, Validators.minLength and Validators.maxLength validators don't work with sets. This is because a set has a size property instead of a length property.

Proposed solution

Validators.required, Validators.minLength and Validators.maxLength validators should work with sets.

Example:

const control = new FormControl(new Set(), [Validators.required])

PR

I already created a PR which in my eyes solved the issue: #45793 (PR has been closed).

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: formsfeatureLabel used to distinguish feature request from other issuesfeature: under considerationFeature request for which voting has completed and the request is now under consideration

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions