我想要在每四件物品中展示我想要的产品。如何使用ng-repeat实现该任务?
main.html 的内容:
<div class="row">
<div class="col s12 m4">
<div class="card blue-grey darken-1" ng-repeat="laptop in data">
<div class="card-content white-text">
<span class="card-title">{{laptop.name}}</span>
</div>
<div class="card-action">
<a href="#">{{laptop.Brand}}</a>
</div>
</div>
</div>
</div>
答案 0 :(得分:2)
只需将ng-repeat放在col
而不是row
..
<div class="row">
<div class="col s12 m4" ng-repeat="laptop in data">
<div class="card blue-grey darken-1">
<div class="card-content white-text">
<span class="card-title">{{laptop.name}}</span>
</div>
<div class="card-action">
<a href="#">{{laptop.Brand}}</a>
</div>
</div>
</div>
</div>