W3cubDocs

/Ember.js 4

Class ManyArray

public
Defined in: ../packages/model/addon/-private/many-array.ts:38
Module: @ember-data/store

isLoaded public

Module: @ember-data/store

The loading state of this array

Module: @ember-data/store

Retrieve the links for this relationship

meta public

Module: @ember-data/store

Metadata associated with the request for async hasMany relationships.

Example

Given that the server returns the following JSON payload when fetching a hasMany relationship:

{
  "comments": [{
    "id": 1,
    "comment": "This is the first comment",
  }, {
// ...
  }],

  "meta": {
    "page": 1,
    "total": 5
  }
}

You can then access the meta data via the meta property:

let comments = await post.comments;
let meta = comments.meta;

// meta.page => 1
// meta.total => 5

© 2022 Yehuda Katz, Tom Dale and Ember.js contributors
Licensed under the MIT License.
https://api.emberjs.com/ember-data/4.9/classes/ManyArray/properties