JSFiddle - React, Tailwind, and code Playground

by mehulkar

HTML

<script src="https://github.com/downloads/wycats/handlebars.js/handlebars-1.0.0.beta.6.js"></script>
<script src="https://raw.github.com/emberjs/ember.js/release-builds/ember-1.0.0-pre.4.js"></script>
<script type="text/x-handlebars" data-template-name="application">
  {{#if myRecord}}
    {{partial record_partial}}
  {{/if}}
    <button {{action deleteRecord myRecord}}>Delete</button>
</script>

<script type="text/x-handlebars" data-template-name="_record_partial">
    <p>I'm a partial</p>
</script>

JavaScript

MyApp = Ember.Application.create();

MyApp.ApplicationController = Ember.Controller.extend({
    myRecord:Ember.Object.create({
        name: 'Mehul',
        computer: 'mac'
    }),
        
    deleteRecord: function(record) {
        record.destroy();
        this.set('myRecord', null);
    }
});