I'm currently in the process of transitioning our application from Angular 4 to Angular 5. In Angular 5, when passing an object model as parameters, if one of the values is null, it gets converted to a "null" string which is causing issues for us. Here's how the parameters are set:
options = {
headers: header, params: Object.getOwnPropertyNames(jsonParamObject)
.reduce((p, key) => p.set(key, jsonParamObject[key]), new HttpParams())
};
In the code above, we use 'jsonParamObject' provided by the method caller. This object can have any number of values. If one of the values is null and we make an http request, the null value is converted to a "null" string. Could you please suggest how this can be avoided or if there's an alternative solution? One option could be to use "0" instead of null, but that would involve significant code changes in our application, so I'm looking for a simpler or better approach.