2016-11-21 2 views

答えて

1

これに角度2のコンポーネントを使用していると仮定すると、サンプルプロジェクトのPartialMatchFilterComponentをご覧ください。

@Component({ 
    selector: 'filter-cell', 
    template: ` 
     Filter: <input style="height: 10px" #input (ngModelChange)="onChange($event)" [ngModel]="text"> 
    ` 
}) 
class PartialMatchFilterComponent implements AgFilterComponent { 
... rest of the class 

、ユーザが入力したとして、あなたの要求をオフに解雇できのonChange方法でザ・(おそらくここでデバウンスのいくつかの並べ替えを追加したいと思います):

onChange(newValue):void { 
    if (this.text !== newValue) { 
     this.text = newValue; 
     ... fire off your http request here ... 
     this.params.filterChangedCallback(); 
    } 
} 
+0

が、これは私のアウトを助けた、ありがとうございました – user2843943

関連する問題