JSFiddle - React, Tailwind, and code Playground

by studgeek

HTML

<script src="http://jshost.googlecode.com/hg/knockout-1.3pre.js"></script>
<h3>Products</h3>

<ul data-bind="if: product">
    <li>
        <strong data-bind="text: product().name"></strong>
        <em>
            &mdash; made by <span data-bind="text: product().manufacturer.company"></span>
        </em>
    </li>
</ul>

CSS

body { font-family: Arial, Helvetica }

JavaScript

function appViewModel() {
    this.product = ko.observable();
};

var avm = new appViewModel();
ko.applyBindings(avm);

<!--
avm.product({
    name: "PlayStation",
    manufacturer: {
        company: "Sony"
    }
});
avm.product({
    name: "XBox"
});
-->