Display list of names in option tagRRRamco Ramco2yAsked May 27, 2024, 7:12 AM802AngularHi How to display list of names . I am trying like below Name {{empName}} > Name {{empName}} > 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('') }); get f(){ return this.form.controls; } getEmployee(){ this.empSrv.getallEmployee().subscribe((result: any)=>{ this.employeeArray = result.data; }) } Thanks3 RepliesKnow the answer? Post it — somebody with the same question will find it here.Sign in to answer this questionIt is the same account you read, post and publish with — and you will come straight back to this page.Sign inCreate an accountAbhishek Chadha2y agoPosted May 27, 2024, 2:22 PMAccepted answerTo display a list of names from an array in HTML using Angular syntax, you can use the *ngFor directive. Here's how you can modify your code: Name {{ item.empName }} RRRamco Ramco2y agoPosted May 27, 2024, 12:19 PMHi I am getting error - NG5002: Unexpected closing tag "option". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags [plugin angular-compiler] Name {{item.empName}} > getEmployee(){ this.empSrv.getallEmployee().subscribe((result: any)=>{ this.employeeArray = result.data; }) } ThanksJobin S2y agoPosted May 27, 2024, 9:26 AMHi ramco, {{item.empname}} try this
Abhishek Chadha2y agoPosted May 27, 2024, 2:22 PMAccepted answerTo display a list of names from an array in HTML using Angular syntax, you can use the *ngFor directive. Here's how you can modify your code: Name {{ item.empName }}
RRRamco Ramco2y agoPosted May 27, 2024, 12:19 PMHi I am getting error - NG5002: Unexpected closing tag "option". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags [plugin angular-compiler] Name {{item.empName}} > getEmployee(){ this.empSrv.getallEmployee().subscribe((result: any)=>{ this.employeeArray = result.data; }) } Thanks