I'm writing a code to search a list in angular, there I need to pass filtering options (form fields) to the API via GET call. this is working but, when there are multi select options (when passing an array within the GET call), there is a problem of doing it
Just think of country list in angular material select with multi option enabled
This is the format of parameters (if there is an error which I should follow in the GET call)
&country[]=LK,&country[]=UK&country[]=US
code is working for normal form fields without any issue, following is the code
return new Promise((resolve, reject) => {
let params = new HttpParams();
let headers = new HttpHeaders({
'Content-Type': 'application/json'
});
params = data;
this._httpClient.get<any>(requestUrl, { headers, params })
.toPromise()
.then(
res => {
How I get the selected options as an array withing GET parameters