有没有一种简单的方法可以使用自动映射器修补 Angular 表单?我想参加一个课程,并将完全相同的成员姓名放入表格中。我宁愿不写,因为公司有多种形式,并尽量远离重复编码(干原则)等
this.editAddressForm.patchValue({
'streetNumber': this.addressMailingData.streetNumber,
'predirectional': this.addressMailingData.predirectional,
'streetName': this.addressMailingData.streetName,
'streetType': this.addressMailingData.streetType,
'postdirectional': this.addressMailingData.postdirectional,
'city': this.addressMailingData.city,
'state': this.addressMailingData.state,
'postalCode': this.addressMailingData.postalCode
尝试的解决方案:这样做会导致以下错误
this.editAddressForm.patchValue(this.addressMailingData);
错误:“string”类型的参数不能分配给“{[key: string]: any;”类型的参数 }'
慕后森
萧十郎
相关分类