Я получаю приведенную ниже ошибку при попытке указать countryName в массиве ответов.
TypeError: this.responsearray.find is not a function
Вот мой код TS
Это то, что я объявил
responsearray: any;
editCountry(row){
let founditem = this.responsearray.find(item => item.countryName==row);
console.log(founditem)
if(founditem !== undefined){
const dialogRef = this.dialog.open(popupcomponent, {
width: '800px',
panelClass: 'custom-modalbox',
disableClose: true,
data: {pageValue:founditem}
});
dialogRef.afterClosed().subscribe(result => {
console.log('The dialog was closed');
if (!result) {
this.loadData();
}
});
}
}
Вот мой интерфейс
export interface assumption {
countryID: number;
CountryName: string;
UserId: number;
UserName: string;
JoiningDate: String;
BirthDate: String;
OverallLength:number;}
Пожалуйста, дайте мне знать, что я здесь не так делаю.