I have a model that comes back from the server which contains html instead of text (for instance a b tag or an i tag)
when I use ng-repeat to built a list out of it i
It goes like ng-bind-html-unsafe="opt.text"
:
-
{{ opt.text }}
{{opt}}
http://jsfiddle.net/gFFBa/3/
Or you can define a function in scope:
$scope.getContent = function(obj){
return obj.value + " " + obj.text;
}
And use it this way:
-
{{ opt.value }}
http://jsfiddle.net/gFFBa/4/
Note that you can not do it with an option
tag: Can I use HTML tags in the options for select elements?