【发布时间】:2015-01-16 10:50:07
【问题描述】:
我需要用从 web api 检索到的数据填充选择元素
我为 web api 使用属性路由
api/project/{pid}/users
如果手动传递参数 pid,它可以正常工作。
我需要使用角度 $http.get() 通过查询字符串传递参数
我试过了
this.getItems = function () {
return $http({
url: '/api/project/{pid}/users',
method: 'GET',
data: $.param({pid:123})
});
}
在提琴手我得到 404 错误。
http://localhost/api/project/%7Bpid%7D/users
我了解了 $location.$Search 和 $routParam,但我需要更多帮助。
【问题讨论】:
标签: javascript angularjs query-string asp.net-web-api