dimanche 10 mai 2015

Ember.js REST Adapter use JSON root(use odata)

The Ember.js REST Adapter expects the JSON to be returned as:

{
    "customer": {
         "CustomerID": "ALFKI",
        "CompanyName": "Alfreds Futterkiste",
        "ContactName": "Maria Anders",
        "ContactTitle": "Sales Representative",
        "id": "b0d16ed0-c901-4ca3-ba41-7fc74c96909f"
   }
}

But my API returns the data without a root element:

{
        "CustomerID": "ALFKI",
        "CompanyName": "Alfreds Futterkiste",
        "ContactName": "Maria Anders",
        "ContactTitle": "Sales Representative",
        "id": "b0d16ed0-c901-4ca3-ba41-7fc74c96909f"
}

I find a question here: Ember.js REST Adapter without JSON root, but the answers is too old, don't works in the newest version of ember and ember-data.

Sorry for my poor English, hope that's clear...




Aucun commentaire:

Enregistrer un commentaire