I am working on a protoype where I use Ember. But I run into problems, when working with embedded records.
I have some json like so:
var facetList = [
{
'Alias' : 'WaterSaving',
'DisplayName' : 'Vand besparende',
'id':47,
'Facets' : [
{
'DisplayName' : 'false',
'FacetId' : 47,
'Value' : 'false',
'id':0
},
{ 'DisplayName' : 'true',
'FacetId' : 47,
'Value' : 'true',
'id':1
}
]
},
{
'Alias' : 'Type',
'DisplayName' : 'Type',
'id':48,
'Facets' : [
{
'DisplayName' : 'håndvask',
'FacetId' : 48,
'Value' : 'håndvask',
'id':2
},
{
'DisplayName' : 'køkken',
'FacetId' : 48,
'Value' : 'køkken',
'id':3
}
]
}
];
So the facetList has embedded facets in each item - these arrays are the ones I refer to as embedded records
As I understand from this blogpost and my own experience, ember does not work with embedded records.
I understand that ember is very opinionated, and that ember would like to work with normalized databases (that from the blogpost) However as I see it when working over for instance a restful API, it makes sense to denormalize the data again, in order to not make the API too chatty.
Do you consider making Ember work more friendly with embedded records? The thing is that this data will never be sent back to the server, so basically i just read and use it for filtering/searching, hence ember.data is not a goood fit for this…
By the way I have this SO if you would like to help me: ember.js - Ember, handlebars and arrays - Stack Overflow