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

Delta Between Two Patch Sets: tests/io-element.js

Issue 29723623: Issue 6487 - IOElement as base component for ABP UI (Closed)
Left Patch Set: Created March 21, 2018, 8:10 a.m.
Right Patch Set: Created March 21, 2018, 2:20 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « tests/io-element.html ('k') | tests/locale/en_US/common.json » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 /* globals module, require */
2
3 "use strict";
4
5 const IOElement = require("../js/io-element");
6
7 class IOClock extends IOElement
8 {
9 connectedCallback()
10 {
11 this._timer = setInterval(() => this.render(), 1000);
12 }
13
14 disconnectedCallback()
15 {
16 clearInterval(this._timer);
17 }
18
19 render()
20 {
21 this.html`
22 ${{i18n: "io_clock"}}
23 @${(new Date()).toLocaleTimeString()}
24 `;
25 }
26 }
27
28 IOClock.define("io-clock");
LEFTRIGHT

Powered by Google App Engine
This is Rietveld