I'm certain its something small and stupid I'm missing but can't seem to get my fixtures to load. Here is I've got...
app/models/todos.js
import DS from 'ember-data';
var Todo = DS.Model.extend({
title: DS.attr('string'),
isCompleted: DS.attr('boolean')
});
Todo.reopenClass({
FIXTURES: [
{
id: "1",
title: 'install ember-cli',
isCompleted: true
}, {
id: "2",
title: 'install additional dependencies',
isCompleted: true
}, {
id: "3",
title: 'develop amazing things',
isCompleted: false
}
]});
export default Todo;
app/adapters/application.js
import DS from 'ember-data';
export default DS.FixtureAdpater.extend();
app/routes/todos.js
import Ember from 'ember';
export default Ember.Route.extend({
model: function() {
return this.store.all('todo');
}
});
app/router.js
import Ember from 'ember';
var Router = Ember.Router.extend({
location: TodosENV.locationType
});
Router.map(function() {
this.resource('todos', { path: '/' });
});
export default Router;
Brocfile.js
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
var app = new EmberApp();
app.import({
development: 'vendor/ember-data/ember-data.js',
production: 'vendor/ember-data/ember-data.prod.js'
}, {
'ember-data': [
'default'
]
});
module.exports = app.toTree();
I've been able to push fixture data into the views via the routes with,
this.store.push(todo: {some junk});
but can't figure out what I'm doing wrong in model files.
Any help would be greatly appreciated, Thanks.