发表于: 2017-05-21 23:16:58
1 997
今天完成的任务:
完成任务9新增模块的编写;
明天的计划:
进行编辑器的学习,引入,完成编辑功能,下线,删除的编写
遇到的问题:
1 在使用ng-if创建出新的选项后,如何使用ng-model进行绑定:
type在行业大图时会出现一个二级下拉框,
title: $scope.editTitle,
type: $scope.selectType || $scope.industryType,
content: $scope.editIns,
暂未解决,暂时没有很好的解决方法。
2 post带数据发送请求无法获取返回值:
这段时间用的get请求比较多,忘了post发送请求与get很不一样,有几个特别要注意的点
method: 'post',
url: '/carrots-admin-ajax/a/u/article',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
data: $.param({
title: $scope.editTitle,
type: $scope.selectType || $scope.industryType,
content: $scope.editIns,
url: $scope.editUrl,
img: $scope.editImg,
status: $scope.statusValue
})
一个是请求头,一个是data数据要序列化,这两点无比要注意。
收获:
表单验证的几个知识点:
$dirty | 表单有填写记录 |
$valid | 字段内容合法的 |
$invalid | 字段内容是非法的 |
$pristine | 表单没有填写记录 |
配合form的name使用,验证是否输入,输入是否符合规则。
评论