JSFiddle - React, Tailwind, and code Playground
by Ryan Duffy
JavaScript
enyo.kind({
name: "ex.Parent",
kind: "Control",
published: {
viaBindings: "",
viaObserver: ""
},
viaObserverChanged: function() {
this.$.observer.set("content", this.viaObserver);
},
bindings: [
// framework will automatically connect bindings
{from:".viaBindings", to:".$.bindings.content"}
],
components: [
{name:"observer"},
{name:"bindings"}
],
create: enyo.inherit(function(sup) {
return function() {
sup.apply(this, arguments);
// have to manually fire the change handler for observers
this.notifyObservers("viaObserver");
};
})
});
new ex.Parent({
viaBindings: "i'm passed via bindings",
viaObserver: "i'm passed via observers"
}).renderInto(document.body);