Convert json & to & in AngularJS

前端 未结 2 1336
灰色年华
灰色年华 2021-01-20 16:00

I have an HTML element that have value attribute. The value should be Comfort & Protection but the name that comes from the JSON get result is Comfort &

2条回答
  •  花落未央
    2021-01-20 16:18

    One option would be to replace the & string with & as below:

    var text = name.replace(/&/g, '&')
    

提交回复
热议问题