Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: tests/io-element.js

Issue 29723623: Issue 6487 - IOElement as base component for ABP UI (Closed)
Patch Set: Created March 21, 2018, 2:20 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/io-element.html ('k') | tests/locale/en_US/common.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/io-element.js
===================================================================
new file mode 100644
--- /dev/null
+++ b/tests/io-element.js
@@ -0,0 +1,28 @@
+/* globals module, require */
+
+"use strict";
+
+const IOElement = require("../js/io-element");
+
+class IOClock extends IOElement
+{
+ connectedCallback()
+ {
+ this._timer = setInterval(() => this.render(), 1000);
+ }
+
+ disconnectedCallback()
+ {
+ clearInterval(this._timer);
+ }
+
+ render()
+ {
+ this.html`
+ ${{i18n: "io_clock"}}
+ @${(new Date()).toLocaleTimeString()}
+ `;
+ }
+}
+
+IOClock.define("io-clock");
« no previous file with comments | « tests/io-element.html ('k') | tests/locale/en_US/common.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld