JSFiddle - React, Tailwind, and code Playground
by Deif
HTML
<script src="https://raw.github.com/wycats/handlebars.js/1.0.rc.2/dist/handlebars.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">
<button {{action "setPerson" target="view"}}>Set Person</button>
</script>
JavaScript
window.App = Em.Application.create();
App.ApplicationView = Em.View.extend({
setPerson: function () {
App.person.set('person', 'test')
}
});
App.Person = Em.Object.extend({
person: null,
personDidChange: function() {
// do something here when the person changes
alert("PERSON CHANGED");
}.observes('person')
});
App.person = App.Person.create();