mercredi 8 mai 2019

How can I model an object that has a plain array of strings with ember data?

How can I model an object that has a plain array of strings? If I do the following it shows me the emails but when modifying their value they are not updated.

The server sends/receives the following data:

"data":
[
    {
        "attributes" : {
            "id":1,
            "name":"Jhon",
            "emails":["jhon@gmail.com","jhon@other.com"]},
            "relationships": (,..}
        }
    }

    ...

Model:

export default Model.extend({
  id: attr('string'),
  name: attr('string'),
  emails: attr('boolean')
})

Template:


    <input type="text" value=>





Aucun commentaire:

Enregistrer un commentaire