URLSearchParams, HttpParams


#1

Hi guys,
I am migrating to Ionic 4. Checking my angular version i am using angular 7.
Can someone please help me to rewrite this assuming HttpClient;

  encodeObject(obj): URLSearchParams {
    let params: URLSearchParams = new URLSearchParams();
    for (var key in obj) {
      if (obj.hasOwnProperty(key)) {
        params.append(key, obj[key]);
      }
    }
    return params;
  }