diff --git a/src/app/grid/grid-validator-service-extended/grid-validator-service-extended.component.ts b/src/app/grid/grid-validator-service-extended/grid-validator-service-extended.component.ts index 8d1616c35..0c09cc2b6 100644 --- a/src/app/grid/grid-validator-service-extended/grid-validator-service-extended.component.ts +++ b/src/app/grid/grid-validator-service-extended/grid-validator-service-extended.component.ts @@ -1,4 +1,4 @@ -import { Component, Directive, Input, ViewChild, ChangeDetectionStrategy } from '@angular/core'; +import { Component, Directive, Input, ViewChild, ChangeDetectionStrategy, forwardRef } from '@angular/core'; import { AbstractControl, FormGroup, NG_VALIDATORS, ValidationErrors, ValidatorFn, Validators } from '@angular/forms'; import { IgxGridComponent } from 'igniteui-angular/grids/grid'; import { IGridFormGroupCreatedEventArgs, IgxCellTemplateDirective, IgxCellValidationErrorDirective, IgxColumnComponent, IgxColumnEmailValidatorDirective, IgxColumnMinValidatorDirective, IgxColumnRequiredValidatorDirective } from 'igniteui-angular/grids/core'; @@ -16,7 +16,7 @@ export function phoneFormatValidator(phoneReg: RegExp): ValidatorFn { @Directive({ selector: '[phoneFormat]', - providers: [{ provide: NG_VALIDATORS, useExisting: PhoneFormatDirective, multi: true }] + providers: [{ provide: NG_VALIDATORS, useExisting: forwardRef(() => PhoneFormatDirective), multi: true }] }) export class PhoneFormatDirective extends Validators { @Input('phoneFormat') diff --git a/src/app/hierarchical-grid/hierarchical-grid-validator-service-extended/hierarchical-grid-validator-service-extended.component.ts b/src/app/hierarchical-grid/hierarchical-grid-validator-service-extended/hierarchical-grid-validator-service-extended.component.ts index 5458cc7a1..490a8bbac 100644 --- a/src/app/hierarchical-grid/hierarchical-grid-validator-service-extended/hierarchical-grid-validator-service-extended.component.ts +++ b/src/app/hierarchical-grid/hierarchical-grid-validator-service-extended/hierarchical-grid-validator-service-extended.component.ts @@ -1,4 +1,4 @@ -import { Component, Directive, Input, ViewChild, ChangeDetectionStrategy } from '@angular/core'; +import { Component, Directive, Input, ViewChild, ChangeDetectionStrategy, forwardRef } from '@angular/core'; import { AbstractControl, NG_VALIDATORS, ValidationErrors, ValidatorFn, Validators } from '@angular/forms'; import { IgxHierarchicalGridComponent, IgxRowIslandComponent } from 'igniteui-angular/grids/hierarchical-grid'; import { IGridFormGroupCreatedEventArgs, IgxCellValidationErrorDirective, IgxColumnComponent, IgxColumnRequiredValidatorDirective, IgxGridToolbarComponent, IgxGridToolbarDirective } from 'igniteui-angular/grids/core'; @@ -15,7 +15,7 @@ export function phoneFormatValidator(phoneReg: RegExp): ValidatorFn { @Directive({ selector: '[phoneFormat]', - providers: [{ provide: NG_VALIDATORS, useExisting: HGridPhoneFormatDirective, multi: true }] + providers: [{ provide: NG_VALIDATORS, useExisting: forwardRef(() => HGridPhoneFormatDirective), multi: true }] }) export class HGridPhoneFormatDirective extends Validators { @Input('phoneFormat') diff --git a/src/app/tree-grid/tree-grid-validator-service-extended/tree-grid-validator-service-extended.component.ts b/src/app/tree-grid/tree-grid-validator-service-extended/tree-grid-validator-service-extended.component.ts index a3c07b828..425cc4894 100644 --- a/src/app/tree-grid/tree-grid-validator-service-extended/tree-grid-validator-service-extended.component.ts +++ b/src/app/tree-grid/tree-grid-validator-service-extended/tree-grid-validator-service-extended.component.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import { Component, Directive, Input, OnInit, ViewChild, ChangeDetectionStrategy } from '@angular/core'; +import { Component, Directive, Input, OnInit, ViewChild, ChangeDetectionStrategy, forwardRef } from '@angular/core'; import { AbstractControl, FormGroup, NG_VALIDATORS, ValidationErrors, ValidatorFn, Validators } from '@angular/forms'; import { IgxTreeGridComponent } from 'igniteui-angular/grids/tree-grid'; import { IGridFormGroupCreatedEventArgs, IgxCellValidationErrorDirective, IgxColumnComponent, IgxColumnMaxValidatorDirective, IgxColumnMinValidatorDirective, IgxColumnRequiredValidatorDirective } from 'igniteui-angular/grids/core'; @@ -17,7 +17,7 @@ export function phoneFormatValidator(phoneReg: RegExp): ValidatorFn { @Directive({ selector: '[phoneFormat]', - providers: [{ provide: NG_VALIDATORS, useExisting: TGridPhoneFormatDirective, multi: true }] + providers: [{ provide: NG_VALIDATORS, useExisting: forwardRef(() => TGridPhoneFormatDirective), multi: true }] }) export class TGridPhoneFormatDirective extends Validators { @Input('phoneFormat')