I’m trying out Ember Data for the first time and I can’t seem to get it to work.
I have an API written in NodeJS (http://localhost:3002) where I can return a collection of states (http://localhost:3002/states).
In my states route I have:
model: function() {
return this.store.find('states');
}
http://localhost:3002/states returns json formatted similar to this when tested with Postman:
[
{
"_id": "33dc0aecde4be108724cd5fz",
"name": "California",
"abbreviation": "CA",
"cities": [
{
"name": "Modesto"
},
{
"name": "Fresno"
}
]
},
{
"_id": "34dc0afcde4be108724cd5fb",
"name": "Florida",
"abbreviation": "FL",
"cities": [
{
"name": "Tallahassee"
},
{
"name": "Orlando"
}
]
}
]
This is what I’m currently seeing in the console in Chrome:
Do I need an adapter, model and serializer? If a model is required…how do I format a model for states that is an array of ‘state’?