【发布时间】:2015-09-05 06:26:37
【问题描述】:
目前正在努力消除我在下面的 json 对象上多余的“,”逗号。
{"rules": {
"1000": {
"action": "2",
"category": "skype",
"entity": "Private",
"id": "1000",
},
"1200": {
"action": "2",
"category": "http",
"entity": "Public",
"id": "1200",
},
"100": {
"action": "2",
"category": "ftp",
"entity": "Public",
"id": "100",
},
"0": {
"entity": "Private",
"category": "alcohol, tobacco",
"action": "1",
"id": "low",
},
"3000": {
} }}
也许您对使用 AngularJS 消除它的最简单方法有一些见解。
数据是从这段代码sn-p解析出来的。
var request = {
url: 'sample/uri',
method: "GET",
transformResponse: specialTransform
};
var response = $q.defer( );
$http( request ).success( function( THIS DATA -> data, status ) {
【问题讨论】:
-
您是在 Angular 中生成该 JSON 还是从某个外部来源接收它?
-
我已经编辑了@Blaise 的问题