2017/2/28
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.一般函数方法的命名就和接口保持一致就可以。
5.显示父子层级。列和列数目要对应。如下:
<tbody ng-repeat="spaceType in spaceTypes">
<tr>
<td ng-bind="$index+1"></td>
<td title={{spaceType.name}} colspan="2">{{spaceType.name}}</td>
<td title={{spaceType.description}}>
<div class="wrap-ellipsis">
{{spaceType.description}}
</div>
</td>
<td class="opt_width_2">
<a ng-click="getSpaceType(spaceType.id)" class="btn btn-icon-only blue" title="编辑"><i class="fa fa-edit"></i></a>
<a href="javascript:;" class="btn btn-icon-only red" title="删除"><i class="glyphicon glyphicon-trash"></i></a>
</td>
</tr>
<tr ng-repeat="child in spaceType.children">
<td></td>
<td></td>
<td title={{child.name}}>{{child.name}}</td>
<td title={{child.description}}>
<div class="wrap-ellipsis">{{child.description}}</div>
</td>
<td>
<a ng-click="getSpaceType(child.id)" class="btn btn-icon-only blue" title="编辑"><i class="fa fa-edit"></i></a>
<a href="javascript:;" class="btn btn-icon-only red" title="删除"><i class="glyphicon glyphicon-trash"></i></a>
</td>
</tr>
</tbody>
只为成功找方法,不为失败找借口!