Skip to content

Instantly share code, notes, and snippets.

@axefrog
Last active December 24, 2015 04:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save axefrog/6745195 to your computer and use it in GitHub Desktop.
Save axefrog/6745195 to your computer and use it in GitHub Desktop.
<!-- snip -->
<script type="text/x-handlebars" data-template-name="data_sources">
<h3>Data Source List</h3>
<section id="data-source-list">
{{#each}}
<div id="data-source-list-item-{{id}}" class="data-source">
<h4>{{name}}</h4>
enabled: {{enabled}}
</div>
{{/each}}
</section>
</script>
window.DataSources = Ember.Application.create();
DataSources.ApplicationAdapter = DS.FixtureAdapter.extend();
DataSources.Router.map(function() {
this.resource('dataSources', { path: '/' });
});
DataSources.DataSourcesRoute = Ember.Route.extend({
model: function() {
var x = this.store.find('datasource');
console.log(x);
return x;
}
});
DataSources.DataSource = DS.Model.extend({
id: DS.attr('string'),
name: DS.attr('string'),
enabled: DS.attr('boolean')
});
DataSources.DataSource.FIXTURES = [{
id: 'google.pagerank',
name: 'Google PageRank',
enabled: true
}, {
id: 'twitter.tweetcount',
name: 'Tweet Count',
enabled: true
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment