1.html页面每个标签的结尾要 /结尾。jsp页面缩进调整好之后再提交
2.java函数代码内、jsp页面不要有空行,用注释代替分割。
3.错误判断提示写在函数里面。在外面没有作用。
$http.post($scope.apiUrl, postData, config).success(function(data, status, headers, config) { console.log("sucess"); $scope.spaceType = data.spaceType; }).error(function(data, status, headers, config) { // 处理错误 console.log("get spaceType error"); }); $scope.dialog.default_title = "编辑空间类别"; showSmallDialog($scope, ‘addSpaceType‘);
$http.post($scope.apiUrl, postData, config).success(function(data, status, headers, config) { $scope.post = data.post; $scope.dialog.default_title = "编辑职务信息"; showSmallDialog($scope, ‘addPost‘); }).error(function(data, status, headers, config) { // 处理错误 console.log("get post error"); });
4.一般函数方法的命名就和接口保持一致就可以。
原文:http://www.cnblogs.com/dth08011122/p/6478065.html