发表于: 2017-07-26 21:43:49

1 938


今天完成的主要是对任务10的收尾,看了一部分ajax,然后开始准备申请复盘的ppt

1. 首先是最后优化了任务10里面根据参数判断内容的状态

$scope.online = function (sta) {
   //根据ng-click点击事件触发函数传参,判断状态是上线还是草稿

   $scope.params.status = sta;

   if ($stateParams.id == undefined) {
       //没有id,内容为新增,上线内容
       //通过赋值方式绑定editor内容
       $scope.params.content = editor.$txt.html();

       $http({
           method: "post",
           url: "/a/u/article",
           params: $scope.params
       }).then(function success(response) {
           $state.go('home.form',{page:1})
       }, function error(response) {
           alert("连接出错")
       });

   } else {
       //id,状态是新增
       $scope.params.content = editor.$txt.html();
       $http({
           method: "put",
           url: "/a/u/article/" + $stateParams.id,
           params:$scope.params
       }).then(function success(response){
           $state.go('home.form',{page:1})
       }, function error(response) {
           alert("连接出错")
       });
   }

};

2. 复习一部分ajax,为小课堂做准备

AJAX 是一种用于创建快速动态网页的技术,等于异步 JavaScript 和 XML。通过在后台与服务器进行少量数据交换,AJAX 可以使网页实现异步更新。这意味着可以在不重新加载整个网页的情况下,对网页的某部分进行更新

3. 开始准备ppt,争取早日复盘


返回列表 返回列表
评论

    分享到