Display HTML special characters in Angular 2 bindings?

后端 未结 7 1347
春和景丽
春和景丽 2020-12-14 15:46

I have a normal binding like this {{foo}} and it displays foo\'s value as text in the HTML. The text that comes from the server is \"R&D\"

7条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-14 16:28

    Base on accepted answer, I made an sample used

    I shared for whom concern.

    TS file
        export class AppComponent  {
          cubicSymbol = 'm²';
        }
    HTML file
        

    Symbol:

    https://stackblitz.com/edit/angular-display-symbols

提交回复
热议问题