I am trying to print json object in textarea using ngModel
.
我做了以下工作:
<textarea style="background-color:black;color:white;" [(ngModel)]='rapidPage' rows="30" cols="120">
</textarea>
我想在文本区域中加载json对象.上面的代码在textarea中加载rapidPage
对象,但它将textarea值显示为[object Object]
.
object:
this.rapidPage = {
"pageRows": [
{
"sections": [
{
"sectionRows": [
{
"secRowColumns": [
]
},
{
"secRowColumns": [
{
"colName": "users"
}
]
},
{
"secRowColumns": [
{
"colName": "sample"
}
]
}
],
"width": 0
}
]
}
],
"pageName": "DefaultPage",
"pageLayout": "DEFAULT_LAYOUT",
"editMode": true
};
我想将数据加载为字符串. 有什么意见吗?