0
我有這個UI在這樣的順序排列:angularJS檢查NG重複與NG-如果交替
AM | PM
AM | PM
AM | PM
AM | PM
,但我的JSON是按以下順序:{AM,AM,AM,AM,PM, PM,PM,PM}
我試圖用NG-重複和NG-IF(您可能會看到下面的代碼),但遺憾的是它加載這樣的:
AM | AM | (note: Am has right border)
AM | AM |
PM PM
PM PM
這裏是我的代碼:
<div class="row main">
<div ng-repeat="forecast in forecasts" class="column-left">
<div ng-if="forecast.hour.indexOf('AM') !== -1" class="row">
//here will be the AM
</div>
<hr>
</div>
<div ng-repeat="forecast in forecasts" class="column-right">
<div ng-if="forecast.hour.indexOf('PM') !== -1" class="row">
//here will be the PM
</div>
<hr>
</div>
</div>
注:我試圖分開ng-repeat,以便它不會混淆但仍然失敗。就像我把它與單一的ng-repeat一樣。
你的問題不清楚,你可以創建一個蹲式或小提琴嗎? –