Skip to content

Instantly share code, notes, and snippets.

Created March 15, 2015 13:34
Show Gist options
  • Save anonymous/bb9f0a9c184856366972 to your computer and use it in GitHub Desktop.
Save anonymous/bb9f0a9c184856366972 to your computer and use it in GitHub Desktop.
title
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>MFiddle</title>
<script type="text/montage-serialization">{
"owner": {
"properties": {
"element": {"#": "owner"}
}
},
"repetition": {
"prototype": "montage/ui/repetition.reel",
"properties": {
"content": [
"One",
"Two",
"Three"
],
"element": {"#": "repetition"}
}
},
"button": {
"prototype": "digit/ui/button.reel",
"properties": {
"element": {"#": "button"}
},
"bindings": {
"label": {"<-": "@repetition:iteration.object"}
},
"listeners": [
{
"type": "action",
"listener": {"@": "owner"}
}
]
}
}</script></head>
<body>
<div data-montage-id="owner">
<ul data-montage-id="repetition">
<button data-montage-id="button"></button>
</ul>
</div>
</body>
</html>
var Component = require("montage/ui/component").Component;
exports.Owner = Component.specialize({
handleAction: {
value: function(event) {
console.log("action: " + event.target.element.textContent);
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment