我想发送页面编号和pagesize到webapi, 但没有参数传递,我debugedd应用程序在VS代码,pagingModel有pageSize和PageNumber成员,他们都有值,但是当我打开chrome dev工具时,请求中没有参数url 我的代码有什么问题吗?不能发送参数与角http.get
getTasks(pagingModel: IPagingModel): Promise<TaskList> {
const url = this.taskUrl;
const params = new URLSearchParams();
let option: RequestOptions;
// tslint:disable-next-line:forin
for (const key in pagingModel) {
params.set(key, pagingModel[key]);
}
option = new RequestOptions({search: params, params: params});
return this.http.get(url, option)
.toPromise()
.then(response => response.json() as TaskList)
.catch(this.handleError);
}
'搜索:params,params:params' - 调用参数名称及其变量'params'是一条冒险的道路。 –
只是试图通过它所有可用的选项中得到, – Arash