如果我有FormControl
this.languageSelectorForm = this.fb.group({
tags: [null, Validators.required],
});
我可以为它分配一个对象作为值吗?
const tag = {"c":"c","s":"h","t":"c"};
formControls['tags'].setValue(tag);
我尝试了上述操作,但出现错误Argument of type '{ ... }' is not assignable to parameter of type 'string'.
分配对象值的方式是什么?我需要它来运行单元测试。