Closed t1m0n closed 8 years ago
Hello, is where any way to get index of item in rt-repeat? e.g.
rt-repeat
<div rt-repeat="item in this.state.items"> <span>Item index is {item.index} or {item._index}</span> </div>
It would be useful for key attribute if items have no ids.
key
I know that I can get index this way:
<div rt-repeat="item in this.state.items" rt-scope="this.state.items.indexOf(item) as index"> <span>Item index is {index}</span> </div>
But I think it would be great if we could be able to get index automatically, what do you think?
index
Thanks.
if you have item in a repeat, then a variable named itemIndex will be automatically put in the scope.
item
itemIndex
@nippur72 Oh thanks, didn't read docs carefully, my bad.
Hello, is where any way to get index of item in
rt-repeat
? e.g.It would be useful for
key
attribute if items have no ids.I know that I can get index this way:
But I think it would be great if we could be able to get
index
automatically, what do you think?Thanks.