ember.js - How to write Ember model for tree type json -
i new ember, can 1 tell me how write ember model json show below. searched lot couldn't come solution
{id:1, name: "a", children: [ { id:1, name: "a1" }, { id:2, name: "a2" }, { id:3, name: "a3", children: [ { id:1, name: "a31", children: [ { id:1, name: "a311" }, { id:2, name: "a312" }, ] }, ] }, ]
thanks
have tried following? have not worked ember data yet, imagine work this:
app.person = ds.model.extend({ id : ds.attr("number"), name : ds.attr("string"), children : ds.hasmany("app.person"), parent : ds.belongsto("app.person") });
Comments
Post a Comment