我知道它似乎是重复的,但事实并非如此。没有什么工作,无论我尝试。无法将JSON对象推入数组
我在我的角度模块列表:
this.checkedInterviews = []
,然后,做一个函数:
var interviewModel = {
interviewId: self.pendingInterviews[i].id,
status: self.pendingInterviews[i].status,
location: self.pendingInterviews[i].location,
start: self.pendingInterviews[i].start,
hideCheck: null
};
this.checkedInterviews.push(JSON.stringify(interviewModel));
我得到Cannot read property 'push' of undefined
。 任何想法是什么问题?
你拼错数组的时候你”已经宣布了它。你在互联网上错过了我。 – Dan
,因为我现在手写那部分,但它在代码 – Mocktheduck
中是正确的,你能否给我们更多的代码?看起来你的函数没有权限访问this.checkedInterviews。 – JOSEFtw