Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/29.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 角度FormArray不显示其任何formControl_Angular_Angular Material_Angular Reactive Forms_Formarray - Fatal编程技术网

Angular 角度FormArray不显示其任何formControl

Angular 角度FormArray不显示其任何formControl,angular,angular-material,angular-reactive-forms,formarray,Angular,Angular Material,Angular Reactive Forms,Formarray,我的FormArray(反应表单)在前端没有显示任何内容,我在控制台中也没有收到任何错误,而如果我通过FormArray登录,我可以看到它的值 我被困在这里面已经快两天了:(我已经看了十几个关于Formarray的视频,都是被动的形式,但没有一个对我有用 我的 this.formGroupMail = this.fb.group({ email: this.fb.array([this.addEmailGroup()]) }); // this loops the

我的FormArray(反应表单)在前端没有显示任何内容,我在控制台中也没有收到任何错误,而如果我通过FormArray登录,我可以看到它的值

我被困在这里面已经快两天了:(我已经看了十几个关于Formarray的视频,都是被动的形式,但没有一个对我有用

我的

this.formGroupMail = this.fb.group({
      email: this.fb.array([this.addEmailGroup()])
    });

    // this loops the mails coming from the service
    this.mailForm = this.formGroupMail.get('email') as FormArray;
    if (this.route.snapshot.data['value'].mails !== undefined) {
      for (const c of this.route.snapshot.data['value'].mails) {
        this.mailForm.push(this.fb.group({descripcion: new FormControl(c.descripcion),
                                          isCc: new FormControl(c.isCc),
                                          isCco: new FormControl(c.isCco)}));

      }
    }

  addEmailGroup() {
    return this.fb.group({
      descripcion: [],
      isCc: [],
      isCco: []
    });
  }

  get mailArray(){
    return this.formGroupMail.get('email') as FormArray;
  } 
我的html:

<form [formGroup]="formGroupMail">
          <ng-component formArrayName="email">
            <div *ngFor="let group of mailArray.controls; let i = index" [formGroupName]="i">
              <div fxLayout="row" fxLayoutGap="0.7rem">
                  <mat-label>E-mail</mat-label>
                  <input formControlName="descripcion" type="text" class="form-control" 
                    placeholder="Email"/>
              </div>
            </div>
         </ng-component>
    </form>

电子邮件