ember.js
ember.js copied to clipboard
Ember.js error: You must include an 'id' for an object passed to 'push'
The REST api which i am using to fetch data doesn't give proper json as expected by Ember.js. I don't have id values in data.
[{"objectID":"340907","owner":"Lokesh"},{"objectID":"340908","owner":"Cherukuri"}]
so i created a a serializer
serializers/baddata.js
import ApplicationSerializer from './application';
export default ApplicationSerializer.extend({
primaryKey: 'objectID'
});
models/baddata.js
import DS from 'ember-data';
export default DS.Model.extend({
objectID: DS.attr('string'),
owner: DS.attr('string')
});
This did not solve the problem.
Wrong repository. Also, issues should be used for reporting bugs. Try using StackOverflow or the Slack channel for help.
Hello, @lc4377. I am closing this since it is not an Emberjs bug. Please, go to #-help channel on Slack. If you are not registered, use the Slackin app.
Thank you!