<script src="https://github.com/downloads/wycats/handlebars.js/handlebars-1.0.0.beta.6.js"></script>
<script src="https://github.com/downloads/emberjs/ember.js/ember-1.0.pre.js"></script>
<script type="text/x-handlebars" data-template-name="application">
<div class="button-container">
<p>
Demonstration of Ember's Run Loop. Each button creates and appends a View and runs code that attempts to color the view's DOM element green, move it around, and change its text, but this can only be done the element's been render by the time the code is run. As shown by this demo, the only way to immediately guarantee that all the necessary bindings have been propagated and DOM elements rendered is to put the view creation code within its own Em.run sub-RunLoop
</p>
<button {{action createView}}>Create View, no sync, no subloop</button><br/>
<button {{action createViewWithRunLoopSync}}>Create View and run Em.run.sync() before report</button><br/>
<button {{action createViewInSubRunLoop}}>Create View in its own sub-RunLoop</button><br/>
</div>
</script>