如何在角的每一行显示两列
how to show two column at each row in angular?
你能告诉我如何在angular中每一行显示两列吗?我需要在每一行显示两列。我试图在每张幻灯片中只显示两行。如果有更多的4个项目,我需要在离子幻灯片上显示项目。我将解释更多
1)首先,我在数组中只取四个对象,我需要在每行中显示两个,如image
所示2)如果有四个以上的对象,我需要使用离子滑动水平滚动。实际上,在我的演示中,每行只显示一列,为什么呢?
是我的代码http://play.ionic.io/app/95a2d932f578
<div id="wrapper">
<ion-slide-box>
<ion-slide>
<div class="row" ng-repeat="d in data">
<div class="col col-50">
<div class="card">
<div class="item item-text-wrap">
{{d.name}}
</div>
</div>
</div>
</div>
</ion-slide>
</ion-slide-box>
</div>
我按照要求为您做了一个小演示,
恰好
控制器
$scope.items = [{
name1: "Product 1",
img1: "https://placehold.it/100x100",
content1: "Awesome",
name2: "Product 2",
img2: "https://placehold.it/100x100",
content2: "cool",
}, {
name1: "Product 3",
img1: "https://placehold.it/100x100",
content1: "Fantstic",
name2: "Product 4",
img2: "https://placehold.it/100x100",
content2: "Not bad",
}, {
name1: "Product 5",
img1: "https://placehold.it/100x100",
content1: "Good",
name2: "Product 6",
img2: "https://placehold.it/100x100",
content2: "best",
}]