1

How do i increment camp by say 3 instead of 1 , each time over here?

<div class="row" ng-repeat="camp in camps">
                <div class="col-lg-3">
            <img src={{camp.img}} alt="" height="200pt" width="250pt"/></div>
            <div class="col-lg-5 col-lg-offset-1">{{camp.email}}<br/>
            <span>{{camp.campname}}</span><br/>
            {{camp.about}}<br/>
            {{camp.tgtamt}}<br/>
            {{camp.enddate}}<br/><br/>
            <button id="view" class="btn btn-default" value1='{{camp.campname}}' value2='{{camp.email}}'>View</button>
            </div></div>
            <hr/>
        </div>
2

1 Answer 1

0

You can try to use $index with ng-show. Something like:

HTML

<div ng-controller = "myCtrl1"> 
 <div class="row" ng-repeat="camp in camps">
 <div ng-show="$index % 3 == 0"> <pre>{{camp.name}}</pre></div>          

    </div>
</div>

Controller

var myApp = angular.module('myModule', []);

myApp.controller('myCtrl1', ['$scope', function($scope) {
$scope.camps=
    [{name:"name_1"},{name:"name_2"},{name:"name_3"},{name:"name_4"},{name:"name_5"},
     {name:"name_6"},{name:"name_7"},{name:"name_8"},{name:"name_9"},{name:"name_10"}];    

}]);

Output:

name_1
name_4
name_7
name_10

see Fiddle

Sign up to request clarification or add additional context in comments.

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.