Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Forms not being populated with values even though its there in browser > developer tools
console.log(data);
{
    "productId": "3",
    "productName": "G500 cpu",
    "productDescription": "gaming computer",
    "productCategory": "computers",
    "units": 5
}
console.log(this.updateForm.value);
{
    "productId": "",
    "productName": "",
    "productDescription": "",
    "productCategory": "",
    "units": ""
}
this.updateForm=this.formBuilder.group(data);
console.log(this.updateForm.value);
{
    "0": {
        "productId": "3",
        "productName": "G500 cpu",
        "productDescription": "gaming computer",
        "productCategory": "computers",
        "units": 5
    }
}


What I have tried:

tried

TypeScript
this.updateForm.setValue(this.product);
this.updateForm.patchValue(this.product);


with no luck
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900