Sbaa
Sbaa
Sbaa
html
<div class="introtext">
<h1>Intro text</h1>
<h3>
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,
when an unknown printer took a galley of type and scrambled it to make a type specimen
book.
It has survived not only five centuries, but also the leap into electronic typesetting,
remaining essentially unchanged.
</h3>
</div>
<div>
<button (click)="navpage()">Apply For Trainer</button>
</div>
landing.ts
@Component({
selector: 'app-landing-page',
templateUrl: './landing-page.component.html'
})
export class LandingPageComponent implements OnInit {
ngOnInit() {
}
navpage() {
// Navigate to the specified route when button is clicked
this.router.navigate(['/place-fitness-trainer-appointment']);
}
}
Place.html
Place.ts
@Component({
selector: 'app-place-fitness-trainer-appointment',
templateUrl: './place-fitness-trainer-appointment.component.html'
})
export class PlaceFitnessTrainerAppointmentComponent implements OnInit {
fitnessForm: FormGroup;
ngOnInit() {
this.fitnessForm = this.formBuilder.group({
inr: ['', Validators.required],
paisa: ['', Validators.required],
streetaddress: ['', Validators.required],
city: ['', Validators.required],
state: ['', Validators.required],
country: ['', Validators.required],
pincode: ['', Validators.required],
phonenumber: ['', Validators.required],
email: ['', [Validators.required, Validators.email]],
firstname: ['', Validators.required],
lastname: ['', Validators.required],
age: ['', Validators.required],
trainerpreference: [''],
physiotherapist: [''],
packages: ['']
});
}
onSubmit() {
this.fitnessForm.value;
console.log(
"LOG: LoginComponent -> onSubmit -> this.fitnessForm.value",
this.fitnessForm.value
);
if (this.fitnessForm.invalid) {
return;
}
const fitnessData = this.fitnessForm.value;
const fitness = new Fitness(
fitnessData.inr,
fitnessData.paisa,
fitnessData.streetaddress,
fitnessData.city,
fitnessData.state,
fitnessData.country,
fitnessData.pincode,
fitnessData.phonenumber,
fitnessData.email,
fitnessData.firstname,
fitnessData.lastname,
fitnessData.age,
fitnessData.trainerpreference,
fitnessData.physiotherapist,
fitnessData.packages
);
this.userService.postfitnessdata(fitness)
.subscribe(
response => {
console.log('Fitness data posted successfully:', response);
this.fitnessForm.reset();
},
error => {
console.error('Error posting fitness data:', error);
}
);
}
}
View.html
<h1>Appointments</h1>
View.ts
import { Component, OnInit } from '@angular/core';
import { HttpClient } from '@angular/common/http';
interface Appointment {
id: number;
name: string;
address: string;
city: string;
package: string;
trainerPreference: string;
phone: string;
}
@Component({
selector: 'app-view-appointment',
templateUrl: './view-appointment.component.html',
})
export class ViewAppointmentComponent implements OnInit {
appointments: Appointment[] = [];
ngOnInit() {
this.fetchAppointments();
}
fetchAppointments() {
this.http.get<Appointment[]>('http://your-api-endpoint/appointments') // Replace with
your actual API endpoint
.subscribe(data => {
this.appointments = data;
});
}
}