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 启动自动完成不';不要提出建议_Angular_Autocomplete_Primeng - Fatal编程技术网

Angular 启动自动完成不';不要提出建议

Angular 启动自动完成不';不要提出建议,angular,autocomplete,primeng,Angular,Autocomplete,Primeng,我以这种方式使用Priming p-autocomplete: <p-autoComplete id="area" [(ngModel)]="areaSearch" [ngModelOptions]="{standalone: true}" [suggestions]="results" (completeMethod)="retrieveArea($event)" field="name"></p-autoComplete> 它在初始化版本4.0.1时运行良好,但在升

我以这种方式使用Priming p-autocomplete:

<p-autoComplete id="area" [(ngModel)]="areaSearch" [ngModelOptions]="{standalone: true}" [suggestions]="results" (completeMethod)="retrieveArea($event)" field="name"></p-autoComplete>
它在初始化版本4.0.1时运行良好,但在升级到4.2.0后,它没有显示关于键入的建议。我认为更新后的代码没有什么不同,但我不明白为什么它不起作用。
有什么建议吗?

这个组件还不稳定。 这方面有一些已知的问题。 我也有同样的问题,在升级到Priming4.3.0之后,一切都正常


从PrimeNG的Github中查看这些内容

谢谢!!!根据您的第一个建议,我解决了这个问题,在我的p-autocomplete元素中添加了[immutable]=“false”。
retrieveArea(event) {
    let searchString = event.query;
    this.results = [];
    searchString = searchString.toUpperCase();
    this.service.retrieveAreaCa(searchString).subscribe(response => {
        if (response.result) {
          this.results = response.data.list;
          //list = [{"name": "Paris", "code": "001"}, ...]
        },
        }
      });
  }