I am developing an Angular 4 application which speaks to a REST API by getting and sending JSON requests.
When I am preparing JSON requests for posting I am doing a lot of manual work to build the JSON..
I AM SURE THERE MUST BE A BETTER WAY THAN THE BELOW using a library or typescript trick.. But haven't been able to find one and am looking for recommendations.
const addressJson = ' { \n ' + this.jsonFormatField('Address', serviceAddress.address) + ',' +
this.jsonFormatField('Address2', serviceAddress.address2) + '\n,' +
this.jsonFormatField('City', address3) + '\n,' +