everyone. I try to get meta data, but it works not equally as I supposed.
This is answer from server:
{
"objects": [{
"id": "82",
"city": "\u041c\u043e\u0441\u043a\u0432\u0430",
"oldStreet": "\u0448\u043e\u0441\u0441\u0435 \u042d\u043d\u0442\u0443\u0437\u0438\u0430\u0441\u0442\u043e\u0432",
"house": "19",
"index": "143912",
"name": "\u042d\u043d\u04
}]
"meta": {
"total": 1234
}
}
This code works fine:
//app/routes/objects.js
var objects = this.store.find('object').then(()=>{
var objectsMeta = this.store.metadataFor("object");
console.log('======================');
console.log(objectsMeta);//Everything is ok, I see data
});
And this code does not:
var objects = this.store.find('object');
var objectsMeta = this.store.metadataFor("object");
I've realized that is because data are not loaded yet, but why should I do it manually? Explain me, please.
Aucun commentaire:
Enregistrer un commentaire