i try to learn ember data. My json server for “Repos” is here : https://api.github.com/orgs/emberjs/repos the format json is not what the ember data except; i now !!! but how can y adjust it ?
my App.js:
App = Ember.Application.create({ LOG_TRANSITIONS: true});
App.Router.map(function(){
this.resource("repos");
});
App.Store = DS.Store.extend({
url: 'https://api.github.com/orgs/emberjs'
});
App.Repos = DS.Model.extend({
name: DS.attr("string"),
full_name: DS.attr("string")
});
App.ReposRoute = Ember.Route.extend({
model: function() {
return this.store.find("repos");
}
});
And my index.html:
<script type="text/x-handlebars" id="application">
<h2> page application</h2>
{{#link-to "repos" }} repos {{/link-to}}
{{outlet}}
</script>
<script type="text/x-handlebars" id="repos">
<h2> page Repos</h2>
<ul>
{{#each}}
<li> {{name}} </li>
{{/each}}
</ul>
</script>
Please don’t tell me to look in officiel ember data guides !!! .
Thanks