Hi
I have below code and i want to display a list of items in a modal column.
export class AttendanceComponent implements OnInit {
attendanceArray: iAttendance [] = [];
objattendance : attendance = new attendance();
employeeArray: any [] = [];
constructor(private empSrv:EmployeeService){
}
ngOnInit(): void {
this.getEmployee();
}
getEmployee(){
this.empSrv.getallEmployee().subscribe((result: any)=>{
this.employeeArray = result.data;
})
}
}
Thanks
Ramco RamcoPosted May 27, 2024, 6:38 AM
Hi Jayraj
I am using reactive form. ng-model is the only way or there can be some other solution
Thanks
Jayraj ChhayaPosted May 27, 2024, 6:00 AM
Hi Ramco,
To display a list of employee names in a modal column in Angular, you can utilize the
employeeArraypopulated with employee data. You can bind this data to theelement in your modal to create a dropdown list of names for user selection.In this code snippet,
employeeArraycontains the list of employees fetched from the API. By using*ngFor, you can iterate over this array and dynamically generateelements within thedropdown, displaying each employee's name. The[(ngModel)]directive can be used to bind the selected employee to a variable likeselectedEmployeein your component.Ramco RamcoPosted May 27, 2024, 5:58 AM
Hi Jignesh
In Modal Popup i have one tag
Thanks
Jignesh KumarPosted May 24, 2024, 9:06 AM
Hello Ramco,
Use this one,