JSFiddle - React, Tailwind, and code Playground
by krisselden
HTML
<script src="http://cloud.github.com/downloads/emberjs/ember.js/ember-0.9.2.js"></script>
<button id="create">Create</button>
<button id="destroy" style="display:none">Destroy</button>
<div id="app-root"></div>
JavaScript
var create$, destroy$, obj;
window.App = Em.Application.create({
rootElement: '#app-root',
hello: 'Hello World!'
});
function create() {
Em.run(function () {
obj = Em.Object.create({contentBinding: 'App.hello'});
});
}
function destroy() {
Em.run(function () {
obj.destroy();
obj = undefined;
});
}
create$ = $('#create');
destroy$ = $('#destroy');
create$.click(function() {
create();
create$.hide();
destroy$.show();
});
destroy$.click(function() {
destroy();
destroy$.hide();
create$.show();
});