【发布时间】:2020-03-21 15:47:44
【问题描述】:
尝试在响应数组中输入 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;}
请让我知道我在这里做错了什么。
【问题讨论】: