1

I have the following:

<div class="columns large-12">
    <p ng-repeat="desc in joinUs.description">{{desc}}</p>
</div>

How can I display html content inside the repeated paragraph? Basically I want to repeat:

<p ng-bind-html="{{desc}}"></p>

joinUs.description is an array of strings, some containing anchor tags.

Edit

I have tried this the following (as suggested angular.js ng-repeat li items with html content) but the html is still shown as plain text.

<div class="row">
    <div class="columns large-12">
        <p ng-repeat="desc in joinUs.description" ng-bind-html-unsafe="desc">{{desc}}</p>
    </div>
</div>
1

1 Answer 1

1

try this:

 <p ng-repeat="desc in joinUs.description" ng-bind-html="desc"></p>

plunkr with similar use is here: http://plnkr.co/edit/wiHj5kwdbb08ag8NQcoJ?p=preview

(it might help, if you add a working sample as plunkr/fiddle or similar)

edit:

ng-bind-html-unsafe has been deprecated. see this stackoverflow question: With ng-bind-html-unsafe removed, how do I inject HTML?

Sign up to request clarification or add additional context in comments.

1 Comment

Working, thanks. I did not include the sanitize script, hence it did not work initially.

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.