Skip to content

Instantly share code, notes, and snippets.

@alexspeller
Forked from samuraisam/myroute.js
Last active August 29, 2015 14:01
Show Gist options
  • Save alexspeller/603a6c9daa3af08b8c74 to your computer and use it in GitHub Desktop.
Save alexspeller/603a6c9daa3af08b8c74 to your computer and use it in GitHub Desktop.
var MyRoute = Ember.Route.extend({
model: function() {
// this will resolve
return Ember.$.ajax().then(function(data) {
// then this will resolve
return Ember.RSVP.hash({
data: data,
items: Em.RSVP.all([
Ember.$.ajax({url: data.item1url}),
Ember.$.ajax({url: data.item2url})
];)
});
})
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment