An ember-cli addon to keep your fixtures separate from your models.
Install the addon and runt the ember-cli blueprint.
npm install ember-cli-fixture-loader --save
ember generate fixture <model-name>
Instead of Model.reopenClass({...})
, your fixtures will be loaded from the /app/fixtures/
folder.
Example /app/models/post.js
import DS from "ember-data";
export default DS.Model.extend({
name: DS.attr("string");
});
Example /app/fixtures/post.js
export default [
{
id: 1,
title: 'Example'
},
{
id: 2,
title: 'Example 2'
}
];
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request