angular.module('push') .factory('replyService', function (ConfigService, $q, UtilService, UserService) { return { //加载评论的回复列表 replyList: function(Id){ var deferred = $q.defer(); var params = { Id: Id }; UtilService.post(ConfigService.server + "getReplyList.action?", params).success(function (response) { deferred.resolve(response); }).error(function (response) { deferred.reject(response); }); return deferred.promise; }, //内页回复提交 appreply: function(infoId,infoType,content,parentId,parentUserId,source){ var deferred = $q.defer(); var params = { infoId: infoId, infoType: infoType, userId: UserService.id, type:1, content:content, parentId:parentId, parentUserId:parentUserId, source:source }; UtilService.post(ConfigService.server + "appComment.action?", params).success(function (response) { deferred.resolve(response); }).error(function (response) { deferred.reject(response); }); return deferred.promise; } } });