Q:

Angular | How to extend a FormGroup after it has be initialized?

Im writing a system in Angular6. The system uses forms, implemented with FormGroup. 
Question: How can I extend the form after init? 
Example:
ngOnInit() {
    this.form = new FormGroup({
          'field_1': new FormControl(null),
          'field_2': new FormControl(null)});

    if (a == 'some value') {
       // Extend this.form with field_2 and field_3
    }
}

A:

There's a method called addControl:
https://angular.io/api/forms/FormGroup#addControl
this.form.addControl('field3', new FormControl(null));

