每个元素插入数组(ng-repeat)

时间:2015-06-02 14:03:17

标签: javascript

所以我有这样的代码:

<div class="row" ng-repeat='days in calCtrl.series track by $index'>
    <div class="cell" ng-repeat='day in days'>
        <h4>{{ $index + 1 }}</h4>
        <img ng-src="{{ day.imgUrl }}">
        <h5>{{ day.date }}</h5>
        <span>{{ day.description }}</span>
        <p ng-show='day.evaluated'>
            <img ng-repeat="x in calCtrl.range(day.stars)" ng-src='img/star.png'></p>
    </div>
</div>

我想做一些像这样的数组:

Arr[0][0] = {{ $index+1}}
Arr[0][1] = {{day.imgUrl}}
Arr[0][2] = {{day.date}}

等 并为每个元素“日复一日”制作它。所以,例如,如果我将有3天的日子,我想做:

Arr[0][0]
Arr[1][0]
Arr[2][0]

我该怎么做?我是全新的javascript:/

0 个答案:

没有答案