<textarea [ngModel]="offers" formControlName="offers"
class="form-control" rows="3">
</textarea>
where offers is an array. It returns output [object Object] . How to displayed it as a JSON format??
<textarea [ngModel]="offers" formControlName="offers"
class="form-control" rows="3">
</textarea>
where offers is an array. It returns output [object Object] . How to displayed it as a JSON format??
If offers is an array of single object than use
<textarea [value]="offers[0] | json" formControlName="offers"
class="form-control" rows="3">
</textarea>
if offers is an object than use
<textarea [value]="offers | json" formControlName="offers"
class="form-control" rows="3">
</textarea>
I hope it helps.
If you want to show data only then do simply like this.
<textarea [ngModel]="offers[0] | json" formControlName="offers" class="form-
control" rows="3"></textarea>
offers is an array thats why you should have to add like this 'offers[0]'