Skip to content

Instantly share code, notes, and snippets.

@amb26
Created September 21, 2013 09:26
Show Gist options
  • Save amb26/6648874 to your computer and use it in GitHub Desktop.
Save amb26/6648874 to your computer and use it in GitHub Desktop.
Declarative model binding from components and subcomponents
fluid.defaults("fluid.tests.fluid3674head", {
gradeNames: ["fluid.standardComponent", "autoInit"],
members: {
fireRecord: []
},
model: {
thing1: {
nest1: 2,
nest2: false
},
thing2: 3
},
events: {
createEvent: null
},
invokers: {
record: "fluid.tests.fluid3674recorder({that}, {arguments}.0, {arguments}.1, {arguments}.2)"
},
components: {
child: {
type: "fluid.standardComponent",
createOnEvent: "createEvent",
options: {
modelListeners: {
"{fluid3674head}.model.thing1.nest2": {
func: "{fluid3674head}.record",
args: ["{change}.path", "{change}.value", "{change}.oldValue"]
}
}
}
}
},
modelListeners: {
"thing1.nest1": {
func: "{that}.record",
args: ["{change}.path", "{change}.value", "{change}.oldValue"]
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment