I am trying to print a json object in textarea using ngModel .
I have done the following:
<textarea style="background-color:black;color:white;" [(ngModel)]='rapidPage' rows="30" cols="120"> </textarea>
I want to load a json object in textarea. The above code loads the rapidPage object in textarea, but shows the value of textarea as [object Object] .
an object:
this.rapidPage = { "pageRows": [ { "sections": [ { "sectionRows": [ { "secRowColumns": [ ] }, { "secRowColumns": [ { "colName": "users" } ] }, { "secRowColumns": [ { "colName": "sample" } ] } ], "width": 0 } ] } ], "pageName": "DefaultPage", "pageLayout": "DEFAULT_LAYOUT", "editMode": true };
I want to load data as a string. any inputs?
json javascript html angular
Bhushan gadekar
source share