2017-04-25 75 views
0

我有一个简单的搜索文本框和值改变,我在调用这个函数(我用Lodash)角2无法读取属性未定义

onKeyCustomerSearch(event: any) { 

    this.SearchCustomerString = event.target.value; 

    this.customersView = _.clone(this.customersArray); 
    this.customersView.paginatedCustomers = _.filter(this.customersView.paginatedCustomers, function (x) { 
     return x.BusinessName.includes(this.SearchCustomerString); 
    }); 
    } 

我越来越无法读取的不确定

财产“SearchCustomerString”

但是,这是工作!

onKeyCustomerSearch(event: any) { 

    this.customersView = _.clone(this.customersArray); 
    this.customersView.paginatedCustomers = _.filter(this.customersView.paginatedCustomers, function (x) { 
     return x.BusinessName.includes(event.target.value); 
    }); 
    } 

回答

相关问题