How do I escape greater than (>) for display on label when using Angular without using innerHTML?

时间:2018-02-01 18:02:08

标签: javascript html angularjs templates angular-directive

I have a data that contains < and >, I want to show this characters avoiding the innerHTML because I have a couple of checkboxs in the label (Also the content is not HTML). The data comes from a JSON.

const labelContent = ' > 1 '; // only for desmostration

Template:

 <label>
    <input type="checkbox" />
    {{labelContent}}
 <label>

Current output:

&lt; 1

I want to know if is possible to show this data.

0 个答案:

没有答案