lundi 10 septembre 2018

Pushing array of string data in model in ember

I have an API response that returns something like this

{
  texts: ["Text1", "Text2", "Text3"]
}

I have created the Ember model as follow (text.js - model file)

import DS from 'ember-data';
export default DS.Model.extend({});

I am unsure of what to add in the attributes for the model since the response is an array of string.

I am also getting

You must include an 'id' for topic in an object passed to 'push'

error with the above snippet.

I am new to ember.js and kind of badly stuck at this point.




Aucun commentaire:

Enregistrer un commentaire