I need to compare values inside ng-repeat
. How to compare previous value with current value inside ng-repeat
. I have an array, having values [2,3]. I want to compare array second value with first. How to do it?
Update: I am displaying current month and date and next seven days. Now if in next seven days there is new month, i mean as january after december, I need to include this month just before the dates of this month.
Ex:: Dec Tue 30, Wed 31, Jan Thu 1, Fri 2 ....
All code is here: Fiddle: http://jsfiddle.net/HB7LU/9763/
<div class="row" style="text-align:center;background-color: #930d14; color: white; height: 55px;">
<div class="col" style="border-right: solid 1px #820d13;">
<p style="transform: rotate(270deg);margin-top: 8px;font-size: 10px;font-weight: 600;text-transform: uppercase;">
{{currentMonth}}</p>
</div>
<div class="col" style="border-right: solid 1px #820d13;" ng-repeat="days in totalDays.aryDates">
<p style="font-size: 10px;font-weight: 500;">{{days}}</p>
<p ng-if="totalDays.aryDates[$index-1] !== totalDays.aryDates[$index]" style="transform: rotate(270deg);margin-top: 8px;font-size: 10px;font-weight: 600;text-transform: uppercase;">
{{newMonth}}</p>
</div>