dimanche 5 juin 2016

ember js get meta informations from json

i have a json data from my server:

{
  "post": {
    "id": 1,
    "title": "Progressive Enhancement is Dead",
    "comments": ["1", "2"],
    "links": {
      "user": "/people/tomdale"
    }
  },

  "meta": {
    "total": 100
  }
}

look exactly like the documentation (http://ift.tt/24rsJvV) i try to get the meta object with no success

export default Ember.Route.extend({
  model() {
    var data = this.store.findAll('post');
    data.then((result) => {
      let meta = result.get('meta');
      console.log(meta); //this return me undefined
    })
    return data;
  }
});




Aucun commentaire:

Enregistrer un commentaire