#Getting Circular Dependency Error when injecting ngControl into component

5 messages · Page 1 of 1 (latest)

slim frigate
#

Getting Circular Dependency Error when injecting ngControl into component

hexed spindle
#

Can you describe exactly what you are trying to accomplish? Is your custom input set up as a valueAccessor?

slim frigate
#

@hexed spindle What I want to accomplish is to create a custom input component, that can be used in a reactive form and receives the validators of the form, when linking them with the formControlNames.

The custom input has ControlValueAccessor implemented and contains all methods, which is inside input.component.ts

#

The problem is that when I want to used it in a form as seen in the parent.component.ts, the form doesnt react at all and the inputs hasnt received the validators.

Then I googled about the problem, where I came across ngControl, so I've added it, but then the circular dependency error occured. Tried to fix it, but it stayed the same

#

Did that answer your question?