简体   繁体   English

自动完成文本在 # 之后转义文本

[英]autocomplete text is escaping text after #

return this.http.get(Configs.BASE_PATH + 'getTaxRates' + query +
                     '&ts='+ Date.now());
query = "?

The issue is that my search query is问题是我的搜索查询是

303 E 14 mile Rd, #305, Clawson, MI 48017 and same is found while debugging in the above code 303 E 14 mile Rd, #305, Clawson, MI 48017 在上面的代码中调试时发现相同

But in the network tab it is coming as但在网络选项卡中,它是作为

searchText: 303 E 14 mile Rd,搜索文本:303 E 14 英里路,

Everything after # is gettting escaped. # 之后的所有内容都被转义了。

IS this a known angular issue?这是一个已知的角度问题吗?

Issue is coming in every version of angular每个版本的 angular 都会出现问题

Try adding the params to your request with:尝试将参数添加到您的请求中:

  let params = new HttpParams();
   params = params.append('myParam', value);
   params = params.append('myOtherParam', value);

this.http.get(myUrl, {params: params});

I believe HttpParams will handled the encoding.我相信 HttpParams 会处理编码。

You will also need to add HttpParams to your existing http import eg:您还需要将 HttpParams 添加到现有的 http 导入中,例如:

import { HttpClient, HttpParams } from '@angular/common/http';

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 选择后如何在剑道自动完成中重置文本 - How to reset the text in kendo autocomplete after selection 选择后搜索文本中的IONIC自动完成选项不会消失 - IONIC Autocomplete option in search text not disappearing after selection DOM 清理 function 不是 escaping 用户输入的文本 - DOM sanitize function is not escaping the text that user entered DOM 清理 function 不是 escaping 用户输入的文本 - DOM sanitize function is not escaping the text that user entered 选择选项后,如何将 Angular Material mat-autocomplete text color 更改为白色? - How can I change Angular Material mat-autocomplete text color to white after an option is chosen? 物料自动完成:将多个文本输入链接到一个自动完成面板 - Material Autocomplete: Link multiple text inputs to one autocomplete panel Chrome自动填充和文本框中的自动填充问题 - Chrome Autofill & Autocomplete Issue on Text Box Angular 材料、自动完成加载指示器和显示文本(未找到结果) - Angular Material, Autocomplete loading indicator and showing text (no results found) mat-autocomplete 自动隐藏输入焦点上的占位符文本 - mat-autocomplete auto-hide placeholder text on input focus 如何在 Angular 6 中单击按钮时获取 ngPrime 自动完成文本 - How to fetch ngPrime autocomplete text on button click in Angular 6
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM