I have this code but when I clicked the Button Test , don't enter the function modelChanged in my App,only enter when de model was create the code is in this link: http://jsfiddle.net/bs38A/16/
enyo.kind({
name: "App",
bindings: [
{from: ".model.foo", to: ".$.notFoo.content"}
],
components: [
{classes: "onyx-toolbar-inline", components:[
{content: "model's 'foo' property:"},
{name: "notFoo"}
]},
{kind: "onyx.Button", content: "Test", ontap: "test"}
],
test: function() {
var m = this.model;
m.set("foo", "model");
},
modelChanged: function(){
this.inherited(arguments);
console.log("Change Model");
}
});
enyo.kind({
name: "MyModel",
kind: "enyo.Model"
});
var app = new App().renderInto(document.body);
var model = new MyModel({foo: "bar"});
app.set("model", model);