idek man ausbildungsnachweise fucking me up frfr ong

This commit is contained in:
csimonis 2024-11-12 08:01:28 +01:00
parent d510c92719
commit 1b1224cba0
16 changed files with 224 additions and 181 deletions

View file

@ -0,0 +1,57 @@
import {Component, EventEmitter, Output} from "@angular/core";
import {FormsModule, ReactiveFormsModule} from "@angular/forms";
import {Lang} from "../idek/lang";
@Component({
standalone: true,
selector: "app-currency",
imports: [
ReactiveFormsModule,
FormsModule
],
template: `
<select [ngModel]="currency" (ngModelChange)="setCurrency($event)">
@for (currency of currencies; track currency.code) {
<option value="{{currency.name}}">{{ currency.name }}</option>
}
</select>
`
})
export class CurrencyComponent {
@Output()
public currency: EventEmitter<Lang> = new EventEmitter();
public currencies: Lang[] = [
{
name: 'de',
code: 'de-DE',
currency: 'EUR'
},
{
name: 'en',
code: 'en-US',
currency: 'USD'
},
{
name: 'jap',
code: 'ja-JP',
currency: 'JPY'
},
{
name: 'cn',
code: 'cn-CN',
currency: 'CNY'
}
]
public setCurrency(currencyInput: string): void {
for (const currency of this.currencies) {
if (currency.name === currencyInput) {
this.currency.emit(currency);
break;
}
}
}
}