0

I want to increment index value by 20. According to code, it can only increase 1. Can anyone please tell me how to solve it using angularjs. or I can use some javascript variable and increase? I dont know how to achieve it.

<td style="vertical-align: top; position:relative; left:{{$index}}" ng-repeat="risks in valuesAtRiskValues" >
            <div style="vertical-align: top;" class="flip-container" id="" onClick="valuesAtRisk(this)">
                <div class="flipper">
                    <div class="valuesAtRisk">                              
                        <div class="varLabel"><span>{{risks.riskType}}</span></div>
                        <div id="flipTop">
                            <div class="valuesAtRiskH">{{risks.riskValueTrimmed}}</div>
                            <div class="varIndicator UP"></div>
                            <div class="varSubHeading">{{risks.riskTitle}}</div>
                        </div>
                    </div>


                </div>
            </div>
        </td>

All td's are almost overlapping. I want to put them side by side.

2 Answers 2

1

I may be missing the point but if you're using it to control the left position can you not just multiply $index by 20 in the binding?

<td style="vertical-align: top; position:relative; left:{{$index * 20}}" ng-repeat="risks in valuesAtRiskValues" >
Sign up to request clarification or add additional context in comments.

Comments

0

By default the $index is incremented with value 1.If you want to increment its value as per your requirement then just add some mathematical calculation according to your requirement.

In this case you just do one thing

<td style="vertical-align: top; position:relative; left:{{$index * 20}}" ng-repeat="risks in valuesAtRiskValues" >

use this code it works for me. I hope you got my point

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.