short answer: you cannot
You just can't. (Well, maybe you can, but it will be hacks!)
long answer: you cannot, but ...
FormControl not FormControl . Directives are injected, but you have to deal with formControlName , ngModel , FormControl , etc., And they will not be accessible from the packaging component, but its children ...
In your case, you can try with @ContentChildren(FormControlName) theControl: any; , since your code FormControlDirective not have a FormControlDirective , but you still cannot access the FormControl (the _control property is internal, soo be a hack) ...
So, you should stick to your mistakes from the component associated with FormGroup .
BUT , if you want to display user input (which will not display the error message as is, but will be able to show that this input is in an error state (the host element will receive ng-valid , ng-invalid , so this is just a style question), you can do this by executing ControlValueAccessor .
The bridge between the control and its own element.
A ControlValueAccessor abstracts the operation of writing a new value to a DOM element that represents an input control.
This means that directives / components implementing this interface can be used with ngModel , FormControl , etc.
for example: <my-component [(ngModel)]="foo"></my-component>
this is not an exact reproduction of your problem, but this implementation solved the same problem for me:
export const INPUT_VALUE_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => InputComponent), multi: true }; @Component({ selector: "field", template: `<!--put anything you want in your template--> <label>{{label}}</label> <input #input (input)="onChange($event.target.value)" (blur)="onTouched()" type="text">`, styles: [], providers: [INPUT_VALUE_ACCESSOR] }) export class InputComponent implements ControlValueAccessor { @ViewChild("input") input: ElementRef; @Input() label:string; onChange = (_: any) => { }; onTouched = () => { }; constructor(private _renderer: Renderer) { } writeValue(value: any): void { const normalizedValue = value == null ? "" : value; this._renderer.setElementProperty(this.input.nativeElement, "value", normalizedValue); } registerOnChange(fn: (_: any) => void): void { this.onChange = fn; } registerOnTouched(fn: () => void): void { this.onTouched = fn; } setDisabledState(isDisabled: boolean): void { this._renderer.setElementProperty(this.input.nativeElement, "disabled", isDisabled); } }
then you can simply:
<field label="Title" formControlName="title"></field>