Skip to content

Instantly share code, notes, and snippets.

@piperswe
Created February 7, 2016 17:23
Show Gist options
  • Save piperswe/015d252842dba175c0bd to your computer and use it in GitHub Desktop.
Save piperswe/015d252842dba175c0bd to your computer and use it in GitHub Desktop.
emberjs.com "LOADING DATA FROM A SERVER" example modification
App.ApplicationRoute = Ember.Route.extend({
model: function() {
return Ember.$.getJSON('https://api.github.com/repos/emberjs/ember.js/pulls?page=1&per_page=3');
}
});
<h3>Last 3 Pull Requests to Ember.js</h3>
<ul>
{{#each model as |pr|}}
<li>
<div class="issue-number">#{{pr.number}}</div>
<div class="issue-title">
<a href={{pr.html_url}}>{{pr.title}}</a>
</div>
<div class="author-name">
Opened by <a href={{pr.head.user.html_url}}><strong>@{{pr.head.user.login}}</strong></a>
</div>
</li>
{{/each}}
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment