javascript - AngularJs Loop Clear -


i'm updating someones code have no idea start, javascript skills not bad i've never used angular , cant head round documentation.

can point me in correct play add break every 3rd item on code?

    <div class="product-holder" ng-class="{'no-margin': ($index%3 == 2)}" ng-repeat="product in products" my-post-repeat-directive>          <h3><a ng-href="#event.buildlink( 'product' )#/{{slug(product)}}">{{product.title}}</a></h3>         <a ng-href="#event.buildlink( 'product' )#/{{slug(product)}}"><img class="product-image" src="assets/images/core/product-details/loading.gif" ng-src="userfiles/shop/products/thumbnails/{{product.thumbnail}}" alt="{{product.title}}"></a>         <div class="details">             <a class="btn btn-orange btn-view" ng-href="#event.buildlink( 'product' )#/{{slug(product)}}">view details</a>             <p ng-class="{'details-no-stock': !isinstock(product)}">{{product | pricetext}}<br>                 <span ng-show="isinstock(product)">in stock</span>                 <span ng-hide="isinstock(product)">out of stock</span>             </p>         </div>     </div>      *i want add clear div here every 3 items in loop. </div> 

many thanks, brent

the $index in main div doing need.

ng-class="{'no-margin': ($index%3 == 2)}" 

you can add div using similar approach (defining clear-div needed):

<div ng-class="{'clear-div': ($index%3 == 0)}" /> 

[edit tidy grammar bit!]


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -