Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4830

How to get meta from after saving model?

$
0
0

@dimas09 wrote:

My server adds meta data to JSON-API response as described in specs. And I try to get it in Ember:

let event = this.get('store').createRecord('event', attr);
event.save()
    .then((e) => {
        console.log(e.get('meta'));
        doSomething(e);
    }).catch((error) => {
        event.deleteRecord();
        handleError(error);
    });

But it returns undefined. I found addon https://github.com/ef4/ember-resource-metadata It store meta-data to WeakMap in service for each model. Is it good solution? Maybe there is native Ember approach?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4830

Trending Articles