Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
192
rated 0 times [  199] [ 7]  / answers: 1 / hits: 50523  / 11 Years ago, wed, july 24, 2013, 12:00:00

My database stores product information, and a lot of this is organised into lists. I load the data into Angular as $scope.post.



For instance,



$scope.post.size_description = '<li> Fits true to size. Take your normal sizer</li>
<li> Slim-cut, mid-rise style</li>
<li> Long in length, alter to fit</li>
<li> Model wears an IT 48r</li>
<li> Model measures: waist size 32, height 6'1/ 185cmr</li>'.


When I try to load this data into my Angular app, it gets rendered as text (i.e. the <li> are not parsed). I understand this probably happens for security reasons, but is there any way around it?


More From » html

 Answers
11

As Damax has said here: https://stackoverflow.com/a/11640420/769083



<div ng-bind-html-unsafe=post.size_description></div>

[#76792] Monday, July 22, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jackeline

Total Points: 245
Total Questions: 92
Total Answers: 100

Location: Ukraine
Member since Sun, Dec 13, 2020
4 Years ago
;