Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add a value inline everytime on ng-repeat

Is it possible to repeat an couple of items and every time it gets repeated it adds something like 10 to the value X.

So lets say I have

<rect ng-repeat="a in b"
x="0" y="0" fill="#00000" width="206.2"
height="117.7"
class=" {{ a.name }} "
/>

What i want to achieve is everytime it gets repeated it adds 10 to the X value, so first one is 0 than 10 than 20 than 30..

like image 266
Dennis Avatar asked Jul 20 '26 02:07

Dennis


1 Answers

You can do like this, it can help

<rect ng-repeat="a in b"
x="{{$index * 10}}" y="0" fill="#00000" width="206.2"
height="117.7"
class=" {{ a.name }} "
/>
like image 97
Rajan Singh Avatar answered Jul 22 '26 14:07

Rajan Singh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!