Skip to content

Expose tree-shakable validator functions via public API #41257

@penfold

Description

@penfold

🐞 bug report

Affected Package

@angular/forms

Is this a regression?

No

Description

Following #41189 in NG 11.2.6. I was expecting to be able to use the new validator functions directly.

e.g. use requiredValidator instead of Validators.required.

After a bit of digging it would seem that they are marked for internal use (?).

In the forms.d.ts, I expected ɵangular_packages_forms_forms_bb to be requiredValidator.

/**
 * @description
 * Provider which adds `RequiredValidator` to the `NG_VALIDATORS` multi-provider list.
 */
export declare const ɵangular_packages_forms_forms_bb: StaticProvider;

/**
 * @description
 * Provider which adds `CheckboxRequiredValidator` to the `NG_VALIDATORS` multi-provider list.
 */
export declare const ɵangular_packages_forms_forms_bc: StaticProvider;

/**
 * @description
 * Provider which adds `EmailValidator` to the `NG_VALIDATORS` multi-provider list.
 */
export declare const ɵangular_packages_forms_forms_bd: any;

/**
 * @description
 * Provider which adds `MinLengthValidator` to the `NG_VALIDATORS` multi-provider list.
 */
export declare const ɵangular_packages_forms_forms_be: any;

/**
 * @description
 * Provider which adds `MaxLengthValidator` to the `NG_VALIDATORS` multi-provider list.
 */
export declare const ɵangular_packages_forms_forms_bf: any;

🔬 Minimal Reproduction

N/A

🔥 Exception or Error

N/A

🌍 Your Environment

Angular Version:
11.2.6

Metadata

Metadata

Assignees

Labels

area: formsfeatureLabel used to distinguish feature request from other issuesfeature: in backlogFeature request for which voting has completed and is now in the backlog

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions