【发布时间】:2016-10-24 05:30:04
【问题描述】:
我正在尝试将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:无法读取未定义的属性“push”
我有什么遗漏吗??
【问题讨论】:
标签: javascript angular typescript ionic2 ionic3