JSFiddle - React, Tailwind, and code Playground
by mediastuttgart
HTML
<script src="https://github.com/downloads/emberjs/ember.js/ember-0.9.8.1.min.js"></script>
<h2>Placeholder</h2>
<script type="text/x-handlebars">
{{#unless App.Model.fullname}}
<span>firstname lastname</span>
{{/unless}}
</script>
<h2>Fullname</h2>
<script type="text/x-handlebars">
{{App.Model.fullname}}
</script>
<h2>Firstname</h2>
<script type="text/x-handlebars">
{{App.Model.firstname}}
</script>
<h2>Lastname</h2>
<script type="text/x-handlebars">
{{App.Model.lastname}}
</script>
CSS
h2 {
font-weight : bold;
margin-top : 10px
}
span {
color : #CCC;
}
JavaScript
window.App = Ember.Application.create();
App.Model = Ember.Object.create({
firstname : null,
lastname : null,
fullname : function () {
return this.get('firstname') + ' ' + this.get('lastname');
}.property('firstname', 'lastname')
});