比如要生成一样的行:
<div class="panel-body"> <ul class="list-group"> <li ng-repeat="timeSheet in timeSheetsOverview | filter:isWorking | orderByDate:‘date‘:true" class="list-group-item" ng-click="$parent.goWeek(timeSheet.date)" ng-include="‘timeItem.html‘"> </li> </ul> </div>
模板:
<script type="text/ng-template" id="timeItem.html"> <div class="row row-2"> <div class="col-xs-10"> <div class="overflow-panel"> <div class="ver-mid-panel overflow"> <span class="font-blue">{{timeSheet.startDateString}} - {{timeSheet.endDateString}} {{timeSheet.yearString}}</span> <br /> <span class="font-small">Week {{timeSheet.weekNumber}}</span> </div> </div> </div> <div class="col-xs-2"> <div class="pull-right"> <div class="ver-mid-panel"> <span class="font-blue">{{timeSheet.totalHours | number:2}}</span> <br /> <br /> </div> </div> </div> </div> </script>
时间: 2024-12-28 19:01:49