简体   繁体   中英

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

But in the network tab it is coming as

searchText: 303 E 14 mile Rd,

Everything after # is gettting escaped.

IS this a known angular issue?

Issue is coming in every version of 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.

You will also need to add HttpParams to your existing http import eg:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM