I want to add search filter and it showed me this error in updateData function.
Property 'first_name' does not exist on type '{}'. Is it problem with typescript or loadsh version or something else?
export class UsersComponent implements OnInit {
public users: any = [];
public filteredData: any;
public filterQuery = "";
public rowsOnPage = 10;
public sortBy = "first_name";
public sortOrder = "asc";
ngOnInit() {
this.authService.getUsersList(userData).subscribe(data => {
var res = data.response;
this.users = this.users;
this.filteredData = res.data;
});
}
public updateData(query:string) {
if(query) {
this.filteredData = _.filter(this.users, (a)=>a.first_name.indexOf(query)>=0);
} else {
this.filteredData = this.users;
}
}
}
In my Angular-cli project I've this code to implemented datatable with search filter. I've used tutorial given using loadsh. http://plnkr.co/edit/grhag1P85teN4ftggkms?p=preview
I want to add search filter and it showed me this error in updateData function. Property 'first_name' does not exist on type '{}'. Is it problem with typescript or loadsh version or something else?
Here is my package.json file with loadsh version