-
-
Notifications
You must be signed in to change notification settings - Fork 111
Expand file tree
/
Copy pathce.html
More file actions
35 lines (34 loc) · 1.06 KB
/
ce.html
File metadata and controls
35 lines (34 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!doctype html>
<script src="../index.js?1"></script>
<script>
class TestCase extends HTMLElement {
static get observedAttributes() { return ['with']; }
attributeChangedCallback() {
document.body.appendChild(document.createTextNode('with value is: ' + this.getAttribute('with')));
document.body.appendChild(document.createElement('br'));
}
connectedCallback() {
document.body.appendChild(document.createTextNode('test-case connected'));
document.body.appendChild(document.createElement('br'));
}
get direct() {
return this._direct;
}
set direct(value) {
this._direct = value;
}
}
customElements.define('test-case', TestCase);
this.onnload = function () {
var rand = Math.random();
var el = hyperHTML.wire()`<test-case with=${'attribute'} direct=${rand}></test-case>`;
setTimeout(function () {
document.body.appendChild(el);
setTimeout(function () {
if (el.direct === el._direct && el.direct === rand) {
document.body.appendChild(document.createTextNode('everything is fine'));
}
}, 10);
}, 10);
};
</script>