Reputation: 8182
What is the proper way of doing this:
<tr ng-repeat="i in controller.model">
<td>{{i.var1}}<br />{{i.var2}}<br />{{i.var3}}</td>
</tr>
When this renders, the <br/>
is displayed as plain text.
Do I really have to define variables for each line that has a <br/>
in it and use the $sce to set it as trusted? That seems awfully silly.
If you find the same question, please let me know what search phrase you used.
When the page is rendered in dev tools, the html looks like this:
<td><p class="ng-binding">Approved.<br>.<br><br><br></p></td>
It is written like this in the page:
<td><p>{{i.ProgramInitiation}}<br>{{i.RejectReasonInitiation}}<br>{{i.RejectReasonOtherInitiation}}</p></td>
Strange. I'll play around with it as it obviously works in plunkr.
Upvotes: 0
Views: 668
Reputation: 732
Looks fine to me. I tried this on a plunker.
<table>
<tr ng-repeat="i in obj">
<td>{{i.name}}<br/>{{i.lastname}}<br/>{{i.lastname}}</td>
</tr>
</table>
Check it out here: http://plnkr.co/edit/BrfLvssZ7IZZzIj2JqRo
Upvotes: 2