Answer the question
In order to leave comments, you need to log in
What is the best way to implement search by matAutocomplete and autocomplete fields?
There is an array of objects unloaded from PostgreSQL:
(modelModel consists, let's say of id (number) and name(string) )
There is such a field with autocompletion:массив$: Observable<Array<модельModel>>;
<mat-form-field>
<input matInput
placeholder="Номер модели"
formControlName="id"
[matAutocomplete]="auto">
<mat-autocomplete #auto="matAutocomplete">
<mat-option *ngFor="let массив of массив$ | async"
[value]="массив.id">
{{ массив.id }}
</mat-option>
</mat-autocomplete>
</mat-form-field>
<mat-input-container>
<input matInput
formControlName="name"
placeholder="Имя модели"
readonly>
</mat-input-container>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question