Home > Software design >  How to remove already present double quotes from strings in Objects in Angular?
How to remove already present double quotes from strings in Objects in Angular?

Time:04-27

Using Angular, Data is being recieved in Object form, from the Database to the Backend to the Frontend. In HTML:

<h3>Payslip for the month of {{dataout[0].MonthYear | json }}</h3>

Where Dataout is the Object recieved which is having multiple entries. The Problem is that when I run the Project, then on website it shows the result like:

Payslip for the month of "February, 2022"

Instead it should show it like:

Payslip for the month of February, 2022

All strings are being shown in double quotes like above.

Any help would be appreciated. Thanks in advance (I am a newbie).

CodePudding user response:

That's because you are using the json pipe.

Just remove the | json at then end of your interpolation.

  • Related