My Ember app is based on a significant amount of common data (think textbook) in addition to arbitrary user data (think bookmarks). I intend to load the common data from fixtures, and to that end I created two data stores, one using ember-data’s REST adapter (for user data) and one using the fixtures adapter (for the common data).
However, the fixtures adapter is not loading fixture data. This jsfiddle is a reduction to minimum of what I’m trying to do: it defines an app, a model, fixtures on that model, a store using the fixtures adapter, and then a controller which gets (or tries to get) its content from the store. But it gets… nothing. What am I doing wrong?
Sylvius = Ember.Application.create();
Sylvius.Section = DS.Model.extend({
// e.g. Surface, Sectional, Pathways, Visual Glossary
title: DS.attr('string')
});
Sylvius.Section.FIXTURES = [{
"id": 1,
"title": "Surface Anatomy"
}, {
"id": 2,
"title": "Sectional Anatomy"
}, {
"id": 3,
"title": "Pathways"
}, {
"id": 4,
"title": "Visual Glossary"
}];
Sylvius.fixtureStore = DS.Store.create({
revision: 4,
adapter: DS.fixtureAdapter
});
Sylvius.sectionController = Em.ArrayController.create({
content: Sylvius.fixtureStore.findAll(Sylvius.Section);
});
It seems like the problem is the
semicolonin theSylvius.sectionControllers’contentdefinition. If you delete it, it works, see http://jsfiddle.net/pangratz666/Kpdqd/: