Search code examples
cssjsonangularstringquotes

Remove quotes Json with Angular


I call to front-end with Angular through the pipe {{item.name | json}} data of type "string" from a json file, how do I remove the quotes with CSS or JS? I see "NameA" but I would like see NameA without quotes.

Exemple of json:

people = [{name: "NameA", name: "NameB"}]

Thanks to those who can give me support


Solution

  • The json pipe returns the json-representation of the variable, which contains quotes.

    If you simply want to output the string, get rid of the json pipe and use {{ item.name }}.