大家好,我正在尝试进行评论表单验证,对于像 Facebook 这样的评论框的每个帖子,但我无法将评论表单与 ngFor 索引与 formControlName="comment" 绑定,所以请任何人帮助我
我已经尝试了很多例子,但没有任何帮助。我是我的代码,所以请仔细检查并帮助我。
<div class="container" style="width: 100%; height: 100%; ">
<div class="row" style=" margin: 1px; background-color: #fff; border: 2px solid #ada5a5; border-radius: 4px; ">
<!-- ngFor for posts -->
<div class="container" *ngFor="let post of posts; let i = index">
<!-- {{post.user_id}}, {{post.post_id}}, {{post.saved_name}}, {{ post.file_path}} -->
<div class="
row" style="border: 1px solid #e6e6e6;">
<div class="col-md-12 col-md-offset-0" style=" height: auto; ">
<h6> {{post.description}} </h6>
</div>
</div>
<div class="row">
<div class="col-md-12" style="display: block; ">
<form [formGroup]="commentForm" (ngSubmit)="comment_Submit(post.user_id, …
Run Code Online (Sandbox Code Playgroud)