我想要一个特定的URL模式。示例如下:
localhost / reports / orderproducts?filter = 1&from = 01.10.2018&to = 31.10.2018&admins = 45%2C32%2C43&product = 0&categories = 5%2C2
现在我得到:
localhost / reports / orderproducts?filter = 1&from = 01.10.2018&to = 31.10.2018&admins = 45&admins = 32&admins = 43&product = 0&categories = 5&categories = 2
submitFiltration(form: NgForm) : void {
let params : Object = MiscUtils.filterObject(this.formData);
params['filter'] = 1;
this.router.navigate([], {queryParams: params});
this.submitted.emit(this.formData);
}
感谢您的帮助。最好的帮助是帮助我理解该方法。预先感谢
答案 0 :(得分:0)
您正尝试在您的示例中显示为URL编码的字符串,例如admins=45%2C32%2
,实际上是admins=45,32,43
,如果要这样显示,则必须将具有join(',')的数组添加到你会被昏迷分开。
示例:
let stringParam = adminsArray.join(',');