Just started hacking or i.e. experimental learning Ember. I have an API that I made used by other clients that gives me a response in the following format.
[ { “pay”: 90000 }, { “pay”: 75000 }, { “pay”: 90000 } ]
From what I understand, I’m supposed to normalize the JSON, saw this ember.js - Transform JSON to an appropriate format for RESTAdapter EmberJS - Stack Overflow
But, it’s not helping.
Here’s my Salary model
export default DS.Model.extend({ pay: DS.attr() });
I’m using the rest adapter and calling salaries from salaries route as:
export default Ember.Route.extend({ model() { return this.get(‘store’).findAll(‘salary’) }
});
Using Mozilla Nightly, I see I’m getting the response but ember inspector shows that a successful request was made and I get the response.
pay 90000 1 Object pay 75000 2 Object pay 90000 3 Object
So I need to parse in those JSON objects and use them. Thanks