问题描述
我有一个输入标签,在输入时,它将根据输入值过滤表中的数据列表.该值是通过请求URL中的查询字符串传递的.通常,我会返回数据并适当地更新表.但是,当搜索井号(#)时,我收到500内部服务器错误.我的问题是,在查询字符串中传递井号时,Angular是否存在已知问题?
I have an input tag and on input it will filter a list of data in a table according to the input value. That value is passed via the query string in the request URL. Typically I get data returned and the table is updated appropriately. However, when searching for the pound sign (#), I am receiving a 500 internal server error. My question is there a known issue with Angular when passing a pound sign in the query string?
推荐答案
传递保留的字符在网址中,您需要使用百分比编码.对于#
,它是%23
.
To pass reserved characters in URLs, you need to use percent encoding. For #
, it's %23
.
The wikipedia page for Percent Encoding has a nice lookup table.
这篇关于使用Angular在URL的查询字符串中将井号传递为值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!