-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.component.ts
More file actions
29 lines (25 loc) · 931 Bytes
/
app.component.ts
File metadata and controls
29 lines (25 loc) · 931 Bytes
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
import { Component, signal, CUSTOM_ELEMENTS_SCHEMA } from "@angular/core";
// Import Elena button class (registers the custom element)
import "@elenajs/components/dist/button.js";
// Import Elena button styles
import "@elenajs/components/dist/button.css";
// Import Elena stack class (registers the custom element)
import "@elenajs/components/dist/stack.js";
// Import Elena stack styles
import "@elenajs/components/dist/stack.css";
@Component({
selector: "app-root",
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
templateUrl: "./app.component.html",
styleUrl: "./app.component.css",
})
export class AppComponent {
count = signal(0);
variants = ["default", "primary", "danger"] as const;
variant = signal<"default" | "primary" | "danger">("default");
cycleVariant() {
const next = this.variants[(this.variants.indexOf(this.variant()) + 1) % this.variants.length];
this.variant.set(next);
}
}