0

I am getting a JSON using AJAX in AngularJS. One of the attributes in the object (say, sample), has a string "<b>String</b>".

I populate this into a table as follows: <td>{{item.sample}} </td>

This gives an output: <b>String</b> on the webpage, when I was actually trying to display String.

Since it is a JSON string, what is currently happening makes sense. How do I use this string and somehow evaluate it so that I see the bold string on the webpage?

1

1 Answer 1

1

Use ngBindHtml directive to render your text.

<td ng-bind-html="item.sample"></td>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.