提交后将控件添加到最近的表单 Angular 6

Add controls to recent form after submit Angular 6

我已经输入了 phone 号码,如果 phone 号码有效,那么该表格将打开更多 5 个输入到完整。

this.contactUsForm = this.formBuilder.group({
     contact_number: ['', Validators.compose([Validators.required, Validators.pattern(this.globalService.pattern)]), {disabled: true}],        
});

如何在不影响我的 contact_number 值的情况下添加更多控件。我只想添加更多这样的控件:

this.contactUsForm = this.formBuilder.group({
       contact_number: ['', Validators.compose([Validators.required, Validators.pattern(this.globalService.pattern)]), {disabled: true}],
       verification_code: ['', Validators.required]
       firstname: ['', Validators.required]
       lastname: ['', Validators.required]
});

我在 contact_number 成功后尝试了这个:

this.contactUsForm.addControl('verification_code',  new FormControl('', Validators.required));

但是我有一个错误错误类型错误:v 不是一个函数

https://stackblitz.com/edit/angular-bf4q3q

谢谢大家的评论。出现错误是因为我在做这个

this.contactUsForm = this.formBuilder.group({
            contact_number: ['', Validators.compose([Validators.required, Validators.pattern(this.globalService.pattern)]), {disabled: true}],
        });

删除后有效 {disabled: true}