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>
Community
  • 1
  • 1
Morne
  • 1,623
  • 2
  • 18
  • 33
  • you can use a directive instead, http://stackoverflow.com/questions/17417607/angular-ng-bind-html-unsafe-and-directive-within-it – Praveen Jul 04 '15 at 09:51

1 Answers1

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?

Community
  • 1
  • 1
Remigius Stalder
  • 1,921
  • 2
  • 26
  • 31
  • Working, thanks. I did not include the sanitize script, hence it did not work initially. – Morne Jul 04 '15 at 09:40