【发布时间】:2014-07-29 12:48:27
【问题描述】:
我按照以下方式将三个参数从我的控制器传递到工厂。
在我的控制器中,我尝试传递三个参数 id、sdt 和 edt ..
$scope.val = function () {
$scope.tech = techRepository.getTech.query({ id: $scope.id, sdt: $scope.sDate, edt: $scope.eDate }, function(data) {
scope.tech = data;
});
};
在我的工厂里有
App.factory('techRepository', ['$resource', function ($resource) {
return {
getTech: $resource('/api/Tech/GetRange/:id', {id: '@id', start: '@sdt', end: '@edt'}, {query: {method: 'GET', isArray:true}})
};
}]);
当我运行此程序时,我收到错误请求错误。请让我知道如何传递多个参数。谢谢
【问题讨论】:
-
在浏览器调试器控制台中查看网络调用。查看正在发送的参数,您可能会对错误有所了解。
标签: javascript angularjs