角度:基于给定数量的增量

时间:2016-04-16 02:54:19

标签: javascript angularjs angularjs-ng-repeat angular-ngmodel

鉴于代码:

<section class="calendar__day--view" ng-init="weekday = date.firstWeekdayOfMonth" ng-model="weekday">
    <div ng-repeat="bill in data.budget.bills">
        <div ng-if="bill.weekday === weekday || bill.date === $parent.$index">
            <strong>{{bill.name}}: {{bill.amount}}</strong>
        </div>
    </div>
</section>

其中date.firstWeekdayOfMonth是星期几(0-6 [sun-sat]),第一天开启,我怎么能增加weekday

例如,如果该月的第一天是星期五(5),我将如何增加?

编辑:这是父级重复:

<div class="calendar__day col-xs-12 col-md-1" ng-repeat="day in calendar.daysInMonthArray" tabindex="0">
    <span class="calendar__day--number">{{day + 1}}</span>
    <app-calendar-day-view></app-calendar-day-view>
</div>

0 个答案:

没有答案