Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/design-patterns/2.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
Javascript 如何在typehaead Angular 4中使用Limito?_Javascript_Angular_Typeahead - Fatal编程技术网

Javascript 如何在typehaead Angular 4中使用Limito?

Javascript 如何在typehaead Angular 4中使用Limito?,javascript,angular,typeahead,Javascript,Angular,Typeahead,如何将typeahead结果的数字限制为5或角度为4的数字? 我在这里附上了官方的plunker链接。我无法使用| limito 这是模板 <section class="col-sm-12"> <div class="search-results style-3"> <input type="text" [value]="query" ngxTypeahead [taUrl]="url" [ta

如何将typeahead结果的数字限制为5或角度为4的数字? 我在这里附上了官方的plunker链接。我无法使用
| limito

这是模板

<section class="col-sm-12">
    <div class="search-results style-3">
      <input type="text" [value]="query"
        ngxTypeahead
        [taUrl]="url"
        [taParams]="params"
        (taSelected)="handleResultSelected($event)"
      >
    </div>
  </section>

在Angular中,没有
limito
过滤器,它被称为

使用
|切片:0:3
而不是limito

<input type="text" ngxTypeahead [value]="query3" [taList]="staticList | slice:0:3" (taSelected)="handleStaticResultSelected($event)">


更新的plnkr:

@sajeetharan以前在哪里被问到的?你能把重复的问题发过去吗?
<input type="text" ngxTypeahead [value]="query3" [taList]="staticList | slice:0:3" (taSelected)="handleStaticResultSelected($event)">