在angular从servlet中获取的list数据是字符串格式,需要转为json格式,于是使用语法:
$scope.findOne=function(id){ typeTemplateService.findOne(id).success( function(response){ $scope.entity= response; $scope.entity.brandIds= JSON.parse($scope.entity.brandIds);//转换品牌列表 $scope.entity.specIds= JSON.parse($scope.entity.specIds);//转换规格列表 $scope.entity.customAttributeItems= JSON.parse($scope.entity.customAttributeItems);//转换扩展属性 } ); }
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。