ngModel for textarea not working in angular 2

后端 未结 8 2011

I am trying to print json object in textarea using ngModel.

I have done following:



ArrayDemo: Array = [{"name":"pardeep","last":"jain"}]
  rapidPage = JSON.stringify(this.ArrayDemo);

Working Example Working Example

Browser shows [object object] because angular unables to parse the JSON the asign the value in ngModel you must need a string so convert this using JSON.stringify

提交回复
热议问题