This repository was archived by the owner on Jan 21, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
53 lines (46 loc) · 1.61 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
<html>
<head>
<title>Aurelia Script Example</title>
</head>
<body>
<h1>Aurelia Script Example</h1>
<secion id="content">
<p>Static Content</p>
</secion>
<script src='https://unpkg.com/[email protected]'></script>
<script>
// "Import" aurelia components
const { InlineViewStrategy } = au;
const aurelia = new au.Aurelia();
// Configure Aurelia
aurelia.use
.standardConfiguration()
.developmentLogging();
// Bootstrap application with Aurelia
aurelia.start()
.then(() => aurelia.setRoot(
// Define inline component as the root
// (this is normally a reference to external file like app.js)
class DynamicButton {
message = "Dynamic";
cycleMessage() {
if (this.message === 'Dynamic') {
this.message = 'Awesome';
} else {
this.message = 'Dynamic';
}
}
getViewStrategy() {
return new InlineViewStrategy(`
<template>
<p>\${message} content</p>
<button click.delegate="cycleMessage()">Change</button>
</template>
`);
}
},
// Specify the element where Aurelia will be hosted in
document.getElementById('content')));
</script>
</body>
</html>