feat: add language selection and currency formatting options
This commit is contained in:
parent
698375b1bf
commit
f96a09abc4
7 changed files with 77 additions and 7 deletions
|
@ -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"
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
Reference in a new issue