admin管理员组文章数量:1302410
**The for the react dynamic question, only the label is displayed (not the text box). There is a mismatch between the .ts and html. What should the constructor contact? *
***appponet.html:***
<div class="form-group col-md-9">
<label for="name">LOB Contact(s)</label>
<div formArrayName="contact_emails">
<div *ngFor="let contact of contact_emails.controls; let i=index; ">
<textarea formControlName="i" style="width:90%;">
</textarea>
<button type="button" class="btn btn-primary btn-xs"
(click)="addContact_Emails()">
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
</button>
<button type="button" *ngIf="i>0" class="btn btn-danger btn-xs"
(click)="removeContact_Emails(i)">
<span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
</button>
</div>
</div>
</div>
***appponent.ts:***
constructor(private fb: FormBuilder) {
this.appForm = this.fb.group({
contact_emails: this.fb.array([]),
});
}
get contact_emails() {
return this.appForm.get('contact_emails') as FormArray;
}
本文标签: Angular form array with Single Value IssueStack Overflow
版权声明:本文标题:Angular form array with Single Value Issue - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741714781a2394042.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论