JSFiddle - React, Tailwind, and code Playground
by Sylvain MINA
HTML
<script src="http://cloud.github.com/downloads/wycats/handlebars.js/handlebars-1.0.rc.1.js"></script>
<script src="http://cloud.github.com/downloads/emberjs/ember.js/ember-1.0.0-pre.2.js"></script>
<button onclick="app.Time.debug1();">Debug1</button>
<button onclick="app.Time.debug2();">Debug2</button>
<button onclick="app.Time.debug3();">Debug3</button>
JavaScript
app = Ember.Application.create();
app.Time = Ember.ArrayController.create({
to: null,
from: null,
rootElement: "#time",
debug1: function() {
this.set('to', 1);
this.set('from', 2);
},
debug2: function() {
this.setProperties( {
'to': 3,
'from': 4
});
},
debug3: function() {
this.beginPropertyChanges();
this.set('to', 5);
this.set('from', 6);
this.endPropertyChanges();
},
date: function(){
return from + to;
}.property('to', 'from'),
search: function() {
alert('called');
}.observes('date')
});