Renaming attributes in a serializer:
export default DS.JSONAPISerializer.extend({
attrs: { results: 'data' }
});
Customizing the key in a list '@identity', '@index', or your own:
<div>
{{#each items key=key as |item i|}}
{{/each}}
</div>
Use Ember Computed macro helpers to make life easier:
import { filterBy, mapBy, reduce, rejectBy } from 'ember-awesome-macros/array';
import raw from 'ember-macro-helpers/raw';
...
myKey: 'test',
prop: filterBy('conditions', raw('newDamage')), // Actually filter by string value
prop2: filterBy('conditions', 'myKey') // Filter by the value of 'myKey' which is 'test'
Ember get returns a promise, but on a nested property, you get a promise that returns a promise
groupPrices.get('driverGroup'); // returns a promise
groupPrices.get('driverGroup.drivers'); // returns a promise that returns a promise (and so forth for each nested attr)