发表于: 2017-04-24 22:52:56
1 905
今天完成的事情:今天做的搜索 失败了,明天去再问一下。
明天计划的事情:把任务8做完吧。
遇到的问题:具体思路,把input里的ng-model的值传到js请求后台的文件,但是打了断点看 我的值是undefined。白天忙活了半天option里的东西,发现这个要写死的。
收获:把option里的东西写死,然后ng repeat 调用。
$scope.articleType=[
{type: 0, name: '首页banner'},
{type: 1, name: '找职位banner'},
{type: 2, name: '找精英banner'},
{type: 3, name: '行业大图'}
];
$scope.articleStatus=[
{type: 1, name: '草稿'},
{type: 2, name: '上线'},
];
本来这两个选择框的想法啊
用if else 去写。
<option ng-repeat="x in articleType " ng-model="artType" value="{{x.type}}">{{x.name}}</option>
$scope.search=function(inputData,type){
if (inputData==$scope.artType){
$http.get("/carrots-admin-ajax/a/article/search",{params:{"size":3,"page":page,"type":type}})
}.then....
可是这么写就报错了。。。
评论