I have a very simple setup. Apologies...no stackblitz for this as it's quite difficult to set up material on Stackblitz without a terminal.
I have the following:
// app.component.html
<form>
<mat-form-field>
<app-simple-input></app-simple-input>
</mat-form-field>
</form>
// simple-input.component.html
<input matInput type="text" [formControl]="control" />
import { Component } from '@angular/core';
import { FormControl } from '@angular/forms';
@Component({
selector: 'app-simple-input',
templateUrl: './simple-input.component.html',
styleUrls: ['./simple-input.component.scss'],
})
export class SimpleInputComponent {
control = new FormControl();
}
This setup does not appear to work, as I get the following error: