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>
You can use
<li data-theme="{{ item.dataTheme }}" ng-repeat="item in items">{{ item.name }}</li>
Demo: Fiddle
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With