[(ngModel)] is not working on custom angular components
<input type="text" [(ngModel)]="term">
Code language: HTML, XML (xml)
The above doesn’t work on custom components, but you can replace with the following:
<input type="text" [value]="term" (input)="term = $event.target.value">
Code language: HTML, XML (xml)
or, an alternative without the need for a component property:
<input matInput type="text" [value]="term || ''" (input)="term = $event.target.value">
Code language: HTML, XML (xml)