Reputation: 23873
I'm struggling to reproduce the official Getting Started TodoMVC app with Ember CLI.
I'm stuck at Using Fixtures. Fixtures just won't load any data.
The app runs fine with no errors and no records. I open the Ember Inspector and i see that my model exists but has no records.
Here's my app's code for you to test: github.com/lolmaus/ember-cli-fixtures-problem-demo .
Below is the code.
Unmodified Ember CLI boilerplate.
`import Ember from 'ember'`
`import config from './config/environment'`
Router = Ember.Router.extend
location: config.locationType
Router.map ->
@resource 'todos', path: '/'
`export default Router`
`import Ember from "ember"`
TodoRoute = Ember.Route.extend
model: -> @store.find 'todo'
`export default TodoRoute`
`import DS from "ember-data"`
FixtureAdapter = DS.FixtureAdapter.extend()
`export default FixtureAdapter`
`import DS from 'ember-data'`
Todo = DS.Model.extend
title: DS.attr 'string'
isCompleted: DS.attr 'boolean'
Todo.reopenClass
FIXTURES:
[
id: 1,
title: 'Learn Ember.js',
isCompleted: true
,
id: 2,
title: '...',
isCompleted: false
,
id: 3,
title: 'Profit!',
isCompleted: false
]
`export default Todo`
PS This question is a duplicate of Ember-cli Fixture loading . I decided to start a new one because i provided a Github project for you to investigate.
Upvotes: 0
Views: 239
Reputation: 23873
Ok, i got this.
The resource was called todos
, but the route file was called todo.coffee
.
Renaming the latter to todos.coffee
resolved the issue.
Upvotes: 1