diff --git a/aurelia-apps/src/examples/counter.html b/aurelia-apps/src/examples/counter.html deleted file mode 100644 index 1d12c03..0000000 --- a/aurelia-apps/src/examples/counter.html +++ /dev/null @@ -1,2 +0,0 @@ -
Current count: ${count}
- \ No newline at end of file diff --git a/aurelia-apps/src/examples/counter.ts b/aurelia-apps/src/examples/counter.ts deleted file mode 100644 index 7585f0c..0000000 --- a/aurelia-apps/src/examples/counter.ts +++ /dev/null @@ -1,7 +0,0 @@ -export class Counter { - count = 0; - - increment() { - this.count++; - } -} diff --git a/aurelia-apps/src/examples/simple-counter.ts b/aurelia-apps/src/examples/simple-counter.ts new file mode 100644 index 0000000..9aeeb28 --- /dev/null +++ b/aurelia-apps/src/examples/simple-counter.ts @@ -0,0 +1,19 @@ +import { customElement } from 'aurelia'; + +@customElement({ + name: 'simple-counter', + template: ` +Current count: \${count}
+ + `, + shadowOptions: { + mode: 'open', + }, +}) +export class SimpleCounter { + count = 0; + + increment() { + this.count++; + } +} diff --git a/aurelia-apps/src/main.ts b/aurelia-apps/src/main.ts index 0ca9322..f828254 100644 --- a/aurelia-apps/src/main.ts +++ b/aurelia-apps/src/main.ts @@ -1,14 +1,13 @@ import { Aurelia, StyleConfiguration } from "aurelia"; import { appMap } from "./app-map"; +// @ts-expect-error - This is a CSS file import sharedStyles from "./shared.css?inline"; // Convert the CSS string to CSSStyleSheet const sheet = new CSSStyleSheet(); sheet.replaceSync(sharedStyles); -console.log(sheet); - document .querySelectorAll("[data-aurelia-app]") .forEach(async (host: HTMLElement) => { diff --git a/themes/aurelia-theme/layouts/examples/single.html b/themes/aurelia-theme/layouts/examples/single.html index fd81f2c..cf69399 100644 --- a/themes/aurelia-theme/layouts/examples/single.html +++ b/themes/aurelia-theme/layouts/examples/single.html @@ -48,7 +48,7 @@+ Build modern web applications with a framework that puts you first. + Simple, powerful, and unobtrusive. +
+ + + +import { customElement } from 'aurelia';
+
+@customElement({
+ name: 'simple-counter',
+ template: `Current count: \${count}
`
+})
+export class SimpleCounter {
+ count = 0;
+
+ increment() {
+ this.count++;
+ }
+}
+ {{ .description }}
@@ -176,7 +222,7 @@A simple counter demonstrating reactive state management in Aurelia 2