diff --git a/aurelia-apps/src/examples/simple-counter.html b/aurelia-apps/src/examples/simple-counter.html new file mode 100644 index 0000000..1d12c03 --- /dev/null +++ b/aurelia-apps/src/examples/simple-counter.html @@ -0,0 +1,2 @@ +
Current count: ${count}
+ \ No newline at end of file diff --git a/aurelia-apps/src/examples/simple-counter.ts b/aurelia-apps/src/examples/simple-counter.ts index 9aeeb28..5f26c94 100644 --- a/aurelia-apps/src/examples/simple-counter.ts +++ b/aurelia-apps/src/examples/simple-counter.ts @@ -1,15 +1,3 @@ -import { customElement } from 'aurelia'; - -@customElement({ - name: 'simple-counter', - template: ` -Current count: \${count}
- - `, - shadowOptions: { - mode: 'open', - }, -}) export class SimpleCounter { count = 0; diff --git a/themes/aurelia-theme/layouts/index.html b/themes/aurelia-theme/layouts/index.html index 6760ea5..07cf17b 100644 --- a/themes/aurelia-theme/layouts/index.html +++ b/themes/aurelia-theme/layouts/index.html @@ -90,28 +90,39 @@import { customElement } from 'aurelia';
-
-@customElement({
- name: 'simple-counter',
- template: `Current count: \${count}
`
-})
-export class SimpleCounter {
+ export class Counter {
count = 0;
increment() {
this.count++;
}
}
+
+
+
+ simple-counter.ts
+ simple-counter.html
+
+ <p>Current count: ${count}</p>
+<button click.trigger="increment()">
+ Increment
+</button>
+