Templating broken?
by Sylvain MINA
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-latest.js"></script>
JavaScript
App = Ember.Application.create();
App.WatchedObject = Ember.Object.extend({
firstProp: null,
secondProp: "bar",
init: function(){
this._super();
var self = this;
Ember.keys(this).forEach(function(key){
if(Ember.typeOf(self.get(key)) !== 'function'){
self.addObserver(key, function(){
console.log(self.get(key));
});
}
});
}
});
App.watched = App.WatchedObject.create({firstProp:"foo", plop: function(){}, thirdProp: 'bar'});
App.watched.set('firstProp', 'trig');
App.watched.set('secondProp', 'dontTrig');
App.watched.set('thirdProp', 'alsoTrig');