我JSON.stringify(data);
用来返回json
这是我的代码
var data;
programService.query({
id: $routeParams.id
}, function (result) {
data = { 'program': result };
data= JSON.stringify(data);
$scope.setPagingData(data,page,pageSize);
});
$scope.setPagingData = function(data, page, pageSize){
var pagedData = data.slice((page - 1) * pageSize, page * pageSize);
$scope.myData = pagedData;
$scope.totalServerItems = data.length;
if (!$scope.$$phase) {
$scope.$apply();
}
};
json数据
{programId:1,
programName:project1,
programContent:content1,
programStartDate:2012-01-01,
templateId: "1"}
结果将是 p , r, o ...
不是programId,1,programName,project1.....
有任何想法吗?