-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpie-only.html
33 lines (28 loc) · 958 Bytes
/
pie-only.html
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
<!doctype html>
<html>
<head>
<script type="text/javascript" src="pie-view.js"></script>
<script type="text/javascript" src="pie-controllers.js"></script>
<script type="text/javascript">
window.session = {};
document.addEventListener('DOMContentLoaded', e => {
fetch('config.json')
.then(r => r.json())
.then(config => {
const model = config.models[0];
return window['pie-controllers']['corespring-choice'].model(model, window.session, { mode: 'gather' })
})
.then(uiModel => {
const el = document.querySelector('corespring-choice');
el.model = uiModel;
el.session = window.session;
})
});
</script>
</head>
<body>
<p>This is an example of using a pie only on a page.</p>
<p>The config is hardcoded into the page, but you'd be expected to load this in somehow.</p>
<corespring-choice pie-id="1"></corespring-choice>
</body>
</html>