When working with Angular 5, I encountered an issue where the API response was returned as 1.0, but when displayed in the HTML field it only showed as 1.
Upon inspecting the response in Chrome dev-tools, under the Network tab -> Response, it correctly displayed as 1.0. However, in the Network Tab -> Preview, it appeared as 1.
I attempted to map the response to a model in Angular, but unfortunately, none of the methods I tried seemed to work.
Response received:
{
amount: 1.0,
quantity : 3.0,
id: "20184563251",
}
this.result = reportResponse.body;
this.cartForm.patchValue(
{
'inputTextField': this.result.amount, // Only 1 is patched while trying to patch
});