I want to show the following attributes as a comma separated list in html:
json {
"city":"<b>londo</b>",
"country":"<i>uk</i>",
"zip":"123"
}
As I have to render the html markup, I'm using ngSanitize. Also I have to apply a filter on each element.
If only one element would be shown, I'd write:
<h3 ng-bind-html="data.country | touppercase"></h3>
But how can I create a oneline comma separated list? How can I append just the three attributes in the h3?
If I'd just use three h3 tags one after the other, I'd have linebreaks between them. So what else could I do?
$scope.joined = Object.keys(json).map(function(key) { return json[key] }).join(",");$scopemethod that returns the joined list, and then useng-bind-html="getJoinedList(data.country) | touppercase"getJoinedListwith the different attributes?