Class 'PhoneFormatDirective' used before its declaration.(2449)
grid-validator-service-extended.component.ts(21, 14): 'PhoneFormatDirective' is declared here.
class PhoneFormatDirective
providers: [
{
provide: NG_VALIDATORS,
useExisting: forwardRef(() => PhoneFormatDirective),
multi: true
}
]
Open these samples in StackBlitz:
All fail to compile due to the custom validator declaration:
Applying
forwardRefwould fix these, i.e.: