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

Side by Side Diff: tests/io-element.test.js

Issue 29723623: Issue 6487 - IOElement as base component for ABP UI (Closed)
Patch Set: Created March 15, 2018, 2:42 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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");
OLDNEW
« js/io-element.js ('K') | « tests/io-element.js ('k') | tests/locale/en_US/common.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld