Created
September 24, 2014 19:26
-
-
Save balinterdi/28b8eae2173fabb71ffc to your computer and use it in GitHub Desktop.
delay-model-resolve.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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