Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1009)

Unified Diff: sky/examples/widgets/index.sky

Issue 812713005: Add declarataive event handlers. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Add tests and fix binding Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sky/framework/sky-element/TemplateBinding.sky » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/examples/widgets/index.sky
diff --git a/sky/examples/widgets/index.sky b/sky/examples/widgets/index.sky
index 88e63ce206d5880cccf9c31911b8368f8f7ed112..d102f85baf950deaeb68e1fe9143126b20cb702f 100644
--- a/sky/examples/widgets/index.sky
+++ b/sky/examples/widgets/index.sky
@@ -16,8 +16,9 @@
</style>
<sky-box title='Buttons'>
- <sky-button id='button'>Button</sky-button>
+ <sky-button id='button' on-click='handleClick'>Button</sky-button>
<div>highlight: {{ myButton.highlight }}</div>
+ <div>clickCount: {{ clickCount }}</div>
</sky-box>
<sky-box title='Checkboxes'>
@@ -47,6 +48,10 @@ module.exports = class extends SkyElement {
attached() {
this.myButton = this.shadowRoot.getElementById('button');
this.myCheckbox = this.shadowRoot.getElementById('checkbox');
+ this.clickCount = 0;
+ }
+ handleClick(event) {
+ this.clickCount++;
}
}.register();
</script>
« no previous file with comments | « no previous file | sky/framework/sky-element/TemplateBinding.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698