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

Unified Diff: sky/tests/resources/test-element.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 | « sky/tests/framework/templates-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/tests/resources/test-element.sky
diff --git a/sky/tests/resources/test-element.sky b/sky/tests/resources/test-element.sky
new file mode 100644
index 0000000000000000000000000000000000000000..c852cd11f80ce5f16036333449a9bdcd3fb20c40
--- /dev/null
+++ b/sky/tests/resources/test-element.sky
@@ -0,0 +1,23 @@
+<!--
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+-->
+<import src="/sky/framework/sky-element/sky-element.sky" as="SkyElement" />
+
+<sky-element name="test-element">
+<template>
+ <div id="inside" on-test-event="handleEvent" attr="{{ value }}">{{ value }}</div>
+</template>
+<script>
+module.exports = class extends SkyElement {
+ created() {
+ this.lastEvent = null;
+ this.value = 10;
+ }
+ handleEvent(event) {
+ this.lastEvent = event;
+ }
+}.register();
+</script>
+</sky-element>
« no previous file with comments | « sky/tests/framework/templates-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698