Removing quotation marks from a json string with replace typescript

0

I need to remove the quotation marks from a string that I get in json, for this I am creating a pipe, but I am not able to remove the double quotes.

I tried something like:

@Pipe({
  name: 'prettyprint'
})
export class PrettyPrintPipe implements PipeTransform {
  transform(val) {
    return JSON.stringify(val, null, 2)
      .replace("\"", "")
      .replace("{", "")
      .replace("}", "");
  }
}

Também tentei:
 .replace('""', "")

But without success, the quotes do not go away.

Any ideas?

    
asked by anonymous 27.09.2018 / 22:28

0 answers