我正在尝试将push
价值迭代到array
json_resp
是 Json 响应。
我的打字稿代码
export class hello {
CategoryLst:any[];
var catIndex,BillerIndex;
for(catIndex = 0; catIndex <= json_resp.category.length; catIndex++) {
var Clst = json_resp.category[0].categoryName;
this.CategoryLst.push(Clst);
}
}
在尝试执行其抛出错误时
原始异常:TypeError:无法读取未定义的属性“推送”
有什么我想念的吗?