Skip to content

Instantly share code, notes, and snippets.

@balinterdi
Created September 24, 2014 19:26
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 balinterdi/28b8eae2173fabb71ffc to your computer and use it in GitHub Desktop.
Save balinterdi/28b8eae2173fabb71ffc to your computer and use it in GitHub Desktop.
delay-model-resolve.js
function wait(value, timeout) {
return new Ember.RSVP.Promise(function(resolve, _) {
window.setTimeout(function() {
Ember.run(function() {
resolve(value);
});
}, timeout);
});
}
App.ChildRoute = Ember.Route.extend({
model: function() {
var delay = 2 * 1000;
return this.find('band').then(function(bands)){
return wait(bands, delay);
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment