답변 3개
채택된 답변
+20 포인트
Angular 가 좋으실듯 합니다.
나라 선택
Copy
import { Component } from '@angular/core';
@Component({
selector: 'app-country-selection',
template: '<select (change)="onCountryChange($event.target.value)"></select>'
})
export class CountrySelectionComponent {
onCountryChange(country: string) {
}
}
도시 선택
Copy
import { Component } from '@angular/core';
@Component({
selector: 'app-city-selection',
template: '<select (change)="onCityChange($event.target.value)"></select>'
})
export class CitySelectionComponent {
onCityChange(city: string) {
}
}
호텔 선택
Copy
import { Component } from '@angular/core';
@Component({
selector: 'app-hotel-selection',
template: '<select (change)="onHotelChange($event.target.value)"></select>'
})
export class HotelSelectionComponent {
onHotelChange(hotel: string) {
}
}
가격 선택
Copy
import { Component } from '@angular/core';
@Component({
selector: 'app-price-selection',
template: '<input type="number" (input)="onPriceChange($event.target.value)" />'
})
export class PriceSelectionComponent {
onPriceChange(price: number) {
}
}
Angular와 HTMX 모두 비동기 요청을 간단하게 처리할 수 있게 해줍니다.
HTML 요소에 hx-get, hx-trigger, hx-target, hx-swap, hx-vals 등의 HTMX 속성을 추가하여 이벤트를 정의하고 HTMX가 어떻게 동작해야 하는지 설정합니다.
참고하시면되겠습니다.
[Django] #15 - Django 게시판 만들기(검색기능 구현)- 6 — 나무늘보의 개발 블로그 (sloth-lifes.com)
답변을 작성하려면 로그인이 필요합니다.