The documentation for this topic is sparse.
The question is simple. I want one of the attributes of this JSON payload to be an object like such:
business-hours : {
monday: {
open: “24hr”,
from: <some time>,
to: <some time>
},
tuesday: {
open: “closed”,
from: <some time>,
to: <some time>
}
},
But I am totally not sure how to make embedded subdocuments in Ember. It looks like I could do a hasMany relationship, and set up a separate model, but that doesn't make sense to me.
Can I not just leave the DS.attr() blank
"businessHours": DS.attr(),
and start shoving things into that object with input values like such?
{{input type="time" value=model.businessHours.wednesday.from}}
having the same problem, would love to hear somebody's perspective on this.
RépondreSupprimerIf we have an embedded subdocument, is it possible to access that data from the same form as the document that it's embedded within?