I have a custom form and custom input.
I am trying to inject the custom form into the custom input.
It works when the input is a direct child of the form, however, when I have a component between them, it throws an exception.
this works:
The AppComponent.html:
<custom-form>
<custom-input></custom-input>
</custom-form>
this doesn't work:
The AppComponent.html:
<custom-form>
<some-component></some-component>
</custom-form>
The some-component html:
<custom-input></custom-input>
the CustomInput constructor:
CustomInput(@Optional() CustomForm form);
I am getting the error EXCEPTION: No provider found for CustomForm.