This is my HTML code. form the example I took the code. sample code. But filtering when typing is not working
<mat-form-field appearance="outline">
<input type="text" formControlName="planClient" matInput placeholder="Plan Client" [matAutocomplete]="auto">
<mat-autocomplete #auto="matAutocomplete">
<mat-option *ngFor="let client of filteredOptions | async" [value]="client">
{{client}}
</mat-option>
</mat-autocomplete>
</mat-form-field>
This is my .ts file
filteredOptions: Observable<string[]>;
clients: string[] = [
'Alabama',
'California',
'Colorado',
'Connecticut',
'SelectHealth',
'UMR'
];
planClient = new FormControl();
this.filteredOptions = this.planClient.valueChanges
.pipe(
startWith(''),
map(value => this._filter(value))
);
public _filter(value: string): string[] {
const filterValue = value.toLowerCase();
return this.clients.filter(client => client.toLowerCase().includes(filterValue));
}