关键代码
this.data={};
// json string
this.dataStr=JSON.stringify(this.data);
// json object
this.convertData=JSON.parse(this.dataStr);
示例代码
https://github.com/zLulus/NotePractice/tree/dev3/Website/DotNetCore/CoreAngular/src/app/json-examples
参考资料
http://choly.ca/post/typescript-json/
转载于:https://www.cnblogs.com/Lulus/p/9483025.html