-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
57 lines (47 loc) · 1.22 KB
/
index.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<!doctype html>
<html>
<head>
<title>Polymer and ES6 Modules</title>
<style>
body {
font-family: sans-serif;
font-size: 1.2em;
color: steelblue;
}
div {
background: lightgrey;
padding: 0.2em;
}
.hello {
color: #444;
}
</style>
</head>
<body>
<div class="hello">Loading a web component with SystemJS</div>
<bio-container>bio-container</bio-container>
<script src="jspm_packages/system.js"></script>
<script src="config.js"></script>
<script>
/**
* Conditionally loads webcomponents polyfill if needed.
* Credit: Glen Maddern (geelen) & Paul Lewis (paullewis)
*/
var webComponentsSupported = ('registerElement' in document && 'import' in document.createElement('link') && 'content' in document.createElement('template'));
if (!webComponentsSupported) {
System.import('webcomponentsjs-lite').then(function() {
loadElements();
});
} else {
loadElements();
}
function loadElements() {
// Use Shadow DOM if available
window.Polymer = window.Polymer || {};
window.Polymer.dom = 'shadow';
// Import elements
System.import('./bio-container');
}
</script>
</body>
</html>