title: How to set value in array form with Angular
body: <p>I want to set value in array like this:</p>
  <pre class="lang-js prettyprint-override"><code>this.form.controls[name].setValue('name')
  </code></pre>
  <p>but I am working with array forms, and this is not working, even if I pass an array index explicitly</p>
  <p>for example, this is my form array and I want to do is to set value in a function</p>
  <pre class="lang-js prettyprint-override"><code>user: FormGroup;
  users: FormGroup;
  
  constructor(private fb: FormBuilder) {}
  ngOnInit() {
    this.user = this.buildGroup();
    this.users = this.fb.group({
      data: this.fb.array([this.user])
    });
  }
  get fData() {
    return this.users.get('data') as FormArray;
  }
  buildGroup() {
    return this.fb.group({
      name: ['', [Validators.required, Validators.minLength(2)]],
      account: this.fb.group({
        email: ['', Validators.required],
        confirm: ['', Validators.required]
      })
    });
  }
  setValue(index) {
    // This doesn't work
    this.fData[index].controls[name].setValue('name')
  }
  onSubmit() {
    this.fData.push(this.buildGroup());
    const {valid, value} = this.fData;
    console.log(valid, value);
  }
  </code></pre>