我的问题是与子对象。 让有这个例子:节点>快递>玉 - 表格模板子对象
tweets = [{id:1, title:"my tweet", author:{id:"sample", name:"Sample Guy"}}] ;
...等 现在如果我想保存,使用快递和玉器,我会做一个表格并设置类似这样的输入:
input#title(type="text", name="tweet[title]", value="new tweet")
没有那里的问题,但我将如何去设置作者的ID /名称?我的猜测没有工作..
input#author(type="text", name="tweet[author[id]]", value="sample")
当我提交建成后尝试console.log('author '+tweet.author.id) ;
刚刚返回undefined。
预先感谢任何帮助,
呵呵..这是非常简单和明显- 谢谢您的帮助! – tomespo44
有时最简单的解决方案是最难以看到的......你非常欢迎 –