angular js判断分类名是否重复。请问报http:404是什么原因呢?findByCategory:function(category,successCall,errorCall){ HttpService.send({method: 'GET',url: '/workType/category' + category},successCall,errorCall);}mmsDirectives.directive('categoryValidation', ['WorkTypeService', function(WorkTypeService) { return { require: 'ngModel', link: function(scope, elm, attrs, ctrl) { ctrl.$parsers.unshift(function(viewValue) { if(viewValue) { WorkTypeService.findByCategory(viewValue, function(workTypes) { if(_.isEmpty(workTypes) || workTypes.category== attrs.categoryValidation) { ctrl.$setValidity('category', true); } else { ctrl.$setValidity('category', false); } }); } return viewValue; }); } };}]);
1 回答
- 1 回答
- 0 关注
- 630 浏览
添加回答
举报
0/150
提交
取消