feat: add language selection and currency formatting options

This commit is contained in:
Jan K9f 2024-09-17 07:47:38 +02:00
commit f96a09abc4
Signed by: jank
GPG key ID: B267751B8AE29EFE
7 changed files with 77 additions and 7 deletions

View file

@ -2,13 +2,36 @@ import { Component } from "@angular/core";
import { ChildComponent } from "../Child/child.component";
import { Input } from "@angular/core";
import { Hotel } from "./hotel";
import { CurrencyPipe } from "@angular/common";
import { FormsModule } from "@angular/forms";
@Component({
selector: 'app-hotel-item',
standalone: true,
templateUrl: './HotelItem.component.html',
imports: [ChildComponent],
imports: [ChildComponent, CurrencyPipe, FormsModule],
})
export class HotelItem {
@Input() public hotel!: Hotel;
public selectedLanguage?: string;
public languageChange(lang: string) {
this.selectedLanguage = lang;
console.log(this.selectedLanguage);
}
public langs = [
{
"lang": "en",
"code": "en-US"
},
{
"lang": "cn",
"code": "cn-CN"
},
{
"lang": "de",
"code": "de-DE"
}
];
}