Hi
I have below code and i want to display a list of items in a modal column.
JavaScript
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;
})
}
}Code
NameThanks

Jignesh KumarRank #91 · 22.9K reputationPosted May 24, 2024, 5:06 AM EDT
Hello Ramco,
Use this one,
Ramco RamcoRank #462 · 5.4K reputationPosted May 27, 2024, 1:58 AM EDT
Hi Jignesh
In Modal Popup i have one tag
Thanks
Jayraj ChhayaRank #304 · 8.2K reputationPosted May 27, 2024, 2:00 AM EDT
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 RamcoRank #462 · 5.4K reputationPosted May 27, 2024, 2:38 AM EDT
Hi Jayraj
I am using reactive form. ng-model is the only way or there can be some other solution
form = new FormGroup({ empId: new FormControl(0), empName: new FormControl(''), empContactNo: new FormControl(''), attendanceId: new FormControl(0), attendanceDate: new FormControl(''), inTime: new FormControl(''), outTime: new FormControl(''), isFullDay: new FormControl('') });Thanks