Skip to content

fix(grids): use forwardRef for validator directives#3995

Open
ddaribo wants to merge 1 commit into
vnextfrom
bpachilova/fix-validator-dirs-3994
Open

fix(grids): use forwardRef for validator directives#3995
ddaribo wants to merge 1 commit into
vnextfrom
bpachilova/fix-validator-dirs-3994

Conversation

@ddaribo

@ddaribo ddaribo commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Closes #3994

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes the Angular compilation error in the grid/tree-grid/hierarchical-grid “validator service extended” samples caused by referencing the validator directive class in the @Directive providers metadata before the class declaration (Issue #3994). This aligns the samples with Angular’s recommended pattern by deferring the class reference via forwardRef.

Changes:

  • Import forwardRef from @angular/core in the affected sample components.
  • Update NG_VALIDATORS provider registrations to use useExisting: forwardRef(() => <DirectiveClass>) in all three samples.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/app/grid/grid-validator-service-extended/grid-validator-service-extended.component.ts Wraps the PhoneFormatDirective validator provider with forwardRef to avoid “used before declaration” compilation failure.
src/app/hierarchical-grid/hierarchical-grid-validator-service-extended/hierarchical-grid-validator-service-extended.component.ts Uses forwardRef for HGridPhoneFormatDirective in NG_VALIDATORS provider to fix compilation.
src/app/tree-grid/tree-grid-validator-service-extended/tree-grid-validator-service-extended.component.ts Uses forwardRef for TGridPhoneFormatDirective in NG_VALIDATORS provider to fix compilation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants