Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 角度材质2自动完成:搜索更改_Angular_Angular Material - Fatal编程技术网

Angular 角度材质2自动完成:搜索更改

Angular 角度材质2自动完成:搜索更改,angular,angular-material,Angular,Angular Material,我第一次使用角度材质,为了精确,我使用了自动完成工具 我有很多数据,我不想在选择输入字段时显示选项列表。相反,我希望在用户每次在字段中键入内容时执行搜索 这是我的密码: <mat-form-field class="example-full-width"> <input type="text" placeholder="Sup bro" aria-label="Number" matInput [matAutocomplete]="auto"&

我第一次使用角度材质,为了精确,我使用了自动完成工具

我有很多数据,我不想在选择输入字段时显示选项列表。相反,我希望在用户每次在字段中键入内容时执行搜索

这是我的密码:

<mat-form-field class="example-full-width">
                <input type="text" placeholder="Sup bro" aria-label="Number" matInput  [matAutocomplete]="auto">
                <mat-autocomplete #auto="matAutocomplete">
                <mat-option (onSelectionChange)="onSelectAdmin($event)" *ngFor="let administrateur of administrateurs" [value]="administrateur">
                    {{administrateur}}
                </mat-option>
                </mat-autocomplete>
</mat-form-field>

{{Administrator}}
因此,我想知道是否可以执行类似于
*ngFor=“let administrator of searchadministrator($event)”[value]=“administrator”>

当然,如果有什么方法可以在每次文本条目更改时调用搜索函数

非常感谢

根据:

showPanel:boolean
可能是您所需要的

自动完成面板是否应可见,取决于选项 长度

更新
添加了带有API调用的示例。

可以,但我在哪里调用SearchAdministrator函数?此函数使用entred执行搜索text@user您可以将搜索附加到输入的值changeHow?事实上,这才是真正的问题所在。谢谢lot@user我附上了一个stackblitz示例,其目的是在输入字段中添加一个valueChange