更改 "UpdateOn"-创建 FormControl 后的行为

Change "UpdateOn"-Behavior after FormControl was created

是否可以在创建 UpdateOn-Behavior 后对其进行更改?看起来像 AbstractControl 的 属性 是只读的:

// Cannot assign to 'updateOn' because it is a read-only property.
this.form.get('field').updateOn = 'blur';

表单是在基础中创建的class,现在我无法控制创建过程。

使用 setControl 替换现有控件。

component.ts

  this.form.setControl('field',new FormControl('', {
    updateOn: 'blur'
  }));