JSFiddle - React, Tailwind, and code Playground

by pjmorse

HTML

<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-0.9.8.1.js"></script>
<script type="text/x-handlebars">
    {{#each App.personController.content}}
        <p>{{fName}} {{surname}}</p>
    {{/each}}
  </script>

JavaScript

// Application
var App = Em.Application.create();

// Models
App.Person = Ember.Object.extend({
    fName: null,
    surname: null
});

// Controller
App.personController = Ember.ArrayController.create({
    content: [],
    init: function(){
        this._super();
        // create an instance of the person model
        var person = App.Person.create({
            fName: 'Fred',
            surname: 'Bloggs'
        });
        this.pushObject(person);
    }
});