I am using mat-autocomplete
but instead of prepopulating the dropdown I would like to wait until the user types soemthing then call a backend service to pupulate it. here is the example I was trying to work off of. My thought process was to add a (keyup)
to the input then call my function as I type:
<mat-form-field class="example-full-width">
<mat-label>Number</mat-label>
<input (keyup)="mycustomfilter($event.key)"**type="text"
placeholder="Pick one"
aria-label="Number"
matInput
[formControl]="myControl"
[matAutocomplete]="auto">
<mat-autocomplete autoActiveFirstOption #auto="matAutocomplete">
<mat-option *ngFor="let option of filteredOptions | async" [value]="option">
{{option}}
</mat-option>
</mat-autocomplete>