-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhello.html
More file actions
35 lines (27 loc) · 821 Bytes
/
hello.html
File metadata and controls
35 lines (27 loc) · 821 Bytes
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>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Hello, world</title>
<template>
Hello, {{name}}.
</template>
</head>
<body>
<script type="module">
import ElementFactory from '../src/ElementFactory.js';
const template = document.querySelector('template');
const factory = new ElementFactory(template);
const { instance, updater } = factory.instantiate({ name: 'world' });
document.body.appendChild(instance);
// Save a reference we can play with in the console.
// Entering a console command like
//
// > updater.update({ name: 'Jane' })
//
// will update the document with the new name.
window.updater = updater;
</script>
</body>
</html>