In my current Angular project, I am working on mapping the response from the following code snippet:
return this.http.get(this.url)
.toPromise()
.then(response => response as IValueSetDictionary[])
.catch(this.handleError);
The response is being mapped to the interface shown below:
export interface IValueSetDictionary {
valueSet: {};
}
This process involves handling a JSON response received from a third-party service that looks like this:
{
"<CONCENTRATE> | 6": "<CONCENTRATE>",
"<PHYSICAL> | 5": "<PHYSICAL>",
"NYMEX WARRANT IN MT | 12": "NYMEX WARRANT IN MT",
"SHFE WARRANT | 13": "SHFE WARRANT"
}
I need some assistance with removing the '<' and '>' symbols from the response.
The desired output should look like this:
{
"CONCENTRATE | 6": "CONCENTRATE",
"PHYSICAL | 5": "PHYSICAL",
"NYMEX WARRANT IN MT | 12": "NYMEX WARRANT IN MT",
"SHFE WARRANT | 13": "SHFE WARRANT"
}
Essentially, I aim to eliminate the '<>' tags during the mapping process in TypeScript, but I haven't found an elegant solution yet.