1

Here is the general idea of what I am trying to accomplish:

The user has an input box. When the user enters text and hits enter the input is sent to a function that inserts it into an array which displays it in an ng-repeat. The actual input is from the array is data binded in a span element like so:

        <span style="text-overflow:ellipsis;">
            {{choice.text}}
        </span>

What I want to do is for the user to enter < b>My text< /b> and then it will be interpreted as html element < b> < /b>inside the span element with text in the middle like so:

        <span style="text-overflow:ellipsis;">
            <b >My text </b>
        </span>

However, it displays it only as text rather than an actual element. Any idea how I can implement that?

2

1 Answer 1

2

Use the attribute ng-bind-html-unsafe

<b ng-bind-html-unsafe>test</b>
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.