Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angularjs ng-repeat item for tag attributes

My question is how can I use item from ng-repeat on the same tag I am declaring ng-repeat

What I need (in some abstract template language):

{% for item in items %}
     <li data-theme="{{ item.dataTheme }}">{{ item.name }}</li>
{% endfor %}

With angular I do not know how to access that item.dataTheme

<li data-theme="{{ item.dataTheme }}" ng-repeat="item in items">{{ item.name }}</li>
like image 534
Vladimir Nani Avatar asked Aug 31 '13 10:08

Vladimir Nani


1 Answers

You can use

<li data-theme="{{ item.dataTheme }}" ng-repeat="item in items">{{ item.name }}</li>

Demo: Fiddle

like image 151
Arun P Johny Avatar answered Oct 11 '22 22:10

Arun P Johny