Accessing Meta-Data

Hi,

I can’t seem to access the meta data via ember-data, and I’m unsure if I’m doing something wrong.

My setup:

Ember: 1.13.8 Ember Data: 1.13.11

With isNewSerializerAPI: true

For testing purposes, in my application serializer I wrote:

export default DS.RESTSerializer.extend({
    isNewSerializerAPI: true,

    extractMeta: function (store, modelClass, payload) {
        return {
            maxPage: 2
        };
    }
});

And I tried to access it:

this.get("store").findAll("listing").then((listings) => {
    listings.get("meta");
    listings.get("content.meta");
});

But they just return undefined. Am I doing something wrong?

If anybody runs into the same problem, apparently meta is not available with findAll. After switching to query I can access it via listings.get("meta"). I guess it would make sense to point this out in the guide?

1 Like