2016-11-21 53 views

回答

1

假设您正在使用Angular 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