如何对一组对象使用ng-repeat?

时间:2016-10-27 18:26:02

标签: angularjs angularjs-ng-repeat

我正在尝试使用ng-repeat使用来自对象数组的数据填充表格,我无法弄清楚我做错了什么。
这是我的对象数组(来自console.log):

schedule1: [Object, Object, Object, Object, Object, Object] 0: Object
elevenAm: "open"
fivePm: "open"
fourPm: "open"
nineAm: "open"
noon: "open"
onePm: "open"
scheduleDate: "Thu Oct 27th"
techName: "Ashley Cox"
tenAm: "open"
threePM: "open"
twoPm: "open"
__proto__: Object1: ObjectelevenAm: "open"
fivePm: "open"
fourPm: "open"
nineAm: "open"
noon: "open"
onePm: "open"
scheduleDate: "Thu Oct 27th"
techName: "Nancy Hall"
tenAm: "open"
threePM: "open"
twoPm: "open"
__proto__: Object2: Object3: Object4: Object5: Objectlength: 6__proto__: Array[0]

Here's a snipet of my HTML:

<md-tabs>
        <md-tab class="all-tabs" label="Today">
            
            <table border="1" class="table table-bordered table-hover table-condensed">
                <thead>
                    <tr>
                        <th>schedule1 date</th>
                        <th>Technician</th>
                        <th>9 AM</th>
                        <th>10 AM</th>
                        <th>11 AM</th>
                        <th>Noon</th>
                        <th>1 PM</th>
                        <th>2 PM</th>
                        <th>3 PM</th>
                        <th>4 PM</th>
                        <th>5 PM</th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="item in controller.schedule1">
                        <td>{{item.scheduleDate}}</td>
                        <td>{{item.techName}}</td>
                        <td>{{item.nineAm}}</td>
                        <td>{{item.nineAm}}</td>
                        <td>{{item.tenAm}}</td>
                        <td>{{item.elevenAm}}</td>
                        <td>{{item.noon}}</td>
                        <td>{{item.onePm}}</td>
                        <td>{{item.twoPm}}</td>
                        <td>{{item.threePm}}</td>
                        <td>{{item.fourPm}}</td>
                        <td>{{item.fivePm}}</td>
                    </tr>
                </tbody>
            </table>
        </md-tab>

    </md-tabs>

关于我做错的任何想法?我有来自这个网站的其他页面,可以完美地使用ng-repeat。

0 个答案:

没有答案
相关问题