Angular 表单 reset() 不会将控件设置为空

Angular form reset() doesn't sets controls to empty

我指的是 Hero guide 像这样传递对象以清空模型中的所有字段。

this.form.reset({
  "firstName": "",
  "lastName": "bzz",
  "reporter": "" 
});

问题是它只设置非空字段,即上面示例中的 bzz。我试过 setValue(...) 但效果相同。谷歌搜索这个问题除了对英雄示例的引用之外什么也没有。

我也试过用下面的。同样的效果。

this.form.get("firstName").patchValue("");

我错过了什么?

不传递对象,它会将所有表单控件设置为空:

this.form.reset();
this.form.reset({
  firstName: {value: '1', disabled: true}
})