Reputation: 86747
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?
Upvotes: 0
Views: 823
Reputation: 86747
Attributes and filters can be concatenated directly withint the angularjs tags:
<h3 ng-bind-html="(data.country | touppercase) + ', ' + (data.city | touppercase) + ', ' + (data.zip)"></h3>
Upvotes: 1