diff --git a/angular/RestClient/src/app/app.config.ts b/angular/RestClient/src/app/app.config.ts index 74b690e0f85b3d2c692cb8d1d0e9b067c6b6ad95..5ceafb91855d50f5955a13713a496522f3b22146 100644 --- a/angular/RestClient/src/app/app.config.ts +++ b/angular/RestClient/src/app/app.config.ts @@ -4,8 +4,8 @@ import { routes } from './app.routes'; import { provideClientHydration } from '@angular/platform-browser'; import { provideHttpClient, withFetch } from '@angular/common/http'; import { provideAnimationsAsync } from '@angular/platform-browser/animations/async'; -import { importProvidersFrom } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; +import { ReactiveFormsModule } from '@angular/forms'; // Added import for ReactiveFormsModule + export const appConfig: ApplicationConfig = { providers: [ @@ -14,6 +14,7 @@ export const appConfig: ApplicationConfig = { provideClientHydration(), provideHttpClient(withFetch()), provideAnimationsAsync(), - ReactiveFormsModule // Asegúrate de incluir ReactiveFormsModule + ReactiveFormsModule + ], }; diff --git a/angular/RestClient/src/app/booking/booking.component.html b/angular/RestClient/src/app/booking/booking.component.html index 9519beb52a3a7473223fe13ffc3c51abbf9c5032..fba44008cc32e506e7ff27ca1d3ad0051b3c068a 100644 --- a/angular/RestClient/src/app/booking/booking.component.html +++ b/angular/RestClient/src/app/booking/booking.component.html @@ -5,7 +5,6 @@ <label for="userId">ID del Usuario:</label> <input type="number" id="userId" formControlName="userId" class="form-control" /> </div> - <div class="form-group"> <label for="hotelId">ID del Hotel:</label> <input type="number" id="hotelId" formControlName="hotelId" class="form-control" /> diff --git a/angular/RestClient/src/app/booking/booking.component.ts b/angular/RestClient/src/app/booking/booking.component.ts index 79bd281d858872344fe2cf0456c7ee2ab5aea57e..b8bd104619cbddefeae2f0743471606049b76863 100644 --- a/angular/RestClient/src/app/booking/booking.component.ts +++ b/angular/RestClient/src/app/booking/booking.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { ReactiveFormsModule, FormGroup, FormBuilder, Validators } from '@angular/forms'; interface BookingRequest { userId: number; // ID del usuario que realiza la reserva hotelId: number; // ID del hotel en el que se realiza la reserva @@ -10,10 +10,13 @@ interface BookingRequest { import { BookingService } from '../booking.service'; // Asegúrate de que el servicio exista @Component({ + standalone : true, + imports : [ReactiveFormsModule], selector: 'app-booking', templateUrl: './booking.component.html', styleUrls: ['./booking.component.css'] }) + export class BookingComponent implements OnInit { bookingForm: FormGroup;