Note that there are some explanatory texts on larger screens.

plurals
  1. USJustin Giancola
    primarykey
    data
    text
    plurals
    1. This table or related slice is empty.
    1. COIt is possibly not rendering because the callback isn't setting `loaded` on the model array being returned. As an aside, that pattern (returning a model right away and using loaded flags to check whether to render) isn't as common in Ember these days. The reason is that in recent versions of the router, if a `model` hook returns a promise, the transition will pause until the promise resolves. As a result, the template won't render until the model data is available so the guard is unnecessary. Anyway, I'm just guessing here. If this doesn't work, post a jsbin and I will comment further.
      singulars
    2. COIf you are interested, the source is here: https://github.com/emberjs/data/blob/4bf1b7a09575ae65e1570a4a4c12c629bdd86a5e/packages/ember-data/lib/serializers/rest_serializer.js#L205-L221
      singulars
    3. COThere are a few different normalization hooks available. The example in [TRANSITION.md](https://github.com/emberjs/data/blob/master/TRANSITION.md) implements `normalize` and munges the payload keys the way you would expect. However, implementing `keyForRelationship` as above has the same effect. The reason is that within the default implementation of `normalize`, `normalizeRelationships` is called which iterates over each relationship defined on the model, uses `keyForRelationship` to find each relationship attribute in the payload, and finally sets the expected model attribute using it.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload