Reputation:
I have a form and i am able to get data in "updateData" variable but still not able to patch values in my form
checkForUpdate()
{
console.log(this.updateData)
this.myReactiveFormsDialog.patchValue({
'username' : this.updateData.username,
'email' : this.updateData.email
});
}
and while i am passing dummy data for e.g 'username' : 'test'
then its patching
result of console
Upvotes: 1
Views: 362
Reputation: 1212
Try like this
checkForUpdate(){
console.log(this.updateData)
this.myReactiveFormsDialog.patchValue(this.updateData[0]);
}
OR
checkForUpdate(){
console.log(this.updateData)
this.myReactiveFormsDialog.patchValue({
username: this.updateData[0].username,
email: this.updateData[0].email
});
}
Upvotes: 1