the method of adding parameter content to httpParams. The official way to write it is:
const httpParams = new HttpParams().set(key,value).set(key,value).set(key.value);
if you want to add multiple parameters, you have to keep .set (), which feels troublesome, and then comes up with an optimized way to write it:
let data = {
aaa:"aaa",
bbb:"bbb",
}
const httpParams = new HttpParams();
for(let key in data){
httpParams.set(key,data[key]);
}
but if you do this, the parameters will not be passed in. Why, is there any solution?