大家好,我有一个函数,当我使用console.log( id )时,我会传递id,它工作得很好,但是为什么我不能在formArray的循环中使用patchValue呢?我希望前5个元素都有相同的id。for(let j=0; j<5; j++) this.myarray.at(j).patchValue([ elementid: id }
我是反应型的新手。我不确定是否可以在不使用get方法的情况下更新FormArray。如果我使用get方法,我会做一些类似于this.editForm.get(“成分”)的事情。现在,我想使用patchValue更新FormArray。这是我的formGroup代码。description: new FormControl(recip.description ,[Validators.required]),
我目前正在使用表单数组处理这个嵌套表单。我尝试将数据修补到userEditForm的一些方法如下:
this.userEditForm.patchValue(user); //user is object received from server从服务器this.userEditForm.patchValue接收到的用户//对象({ userId: user.userId,userName: user.userName,地址: user.address)};this
一旦用户将点击编辑按钮,我想补丁数据的反应形式。目前,我能够修补正常字段的值。但在动态字段和数组中无法修补值。_trainnerservice.currentTrainner = Object.assign({}, trainner); addlanguages_known(): any {
const control = this.registrationForm.get('languages_known') as <