jsonember.jsember-model

Ember Models Table - JSON records


Has anyone successfully loaded a JSON file externally via an ajax call in Ember Models Table?

I was hoping this example would work, but there is no associated coded with it. Currently it seems it only works, if you grab your data from your ember store. But maybe there is a way to inject the records another way?

Perhaps passing it to 'model' somehow?:

{{models-table
          data=model
          columns=columns}}

Solution

  • I ended up simply doing a Ember.$.getJSON in the model.

    model: function(params) {
        return Ember.$.getJSON('***YOUR_URL_HERE***').then((data) => {
            return this.store.push({
                data: data
            });
        });
    }