Angular Ng重复中继器

时间:2016-06-19 08:21:55

标签: angularjs

我正在创建一个有角度的座位预订系统。我的脚本从行和列生成多维数组。除了当我从数据库中检索json数据并尝试打印座位系统时,每件事情都正常工作,它会返回重复的转发器错误。

以下是我正在使用的转发器代码:

<table class="em_venue_seating">

                <tr ng-repeat="row in term.seats" class="row isles_row_spacer" id="row{{$index}}" ng-style="{'margin-top':row[0].rowMargin}"> 


                    <td class="row_selection_bar" ng-click="selectRow($index)">
                        <div>Select Row</div>
                    </td>

                    <td ng-repeat="seat in row" class="seat isles_col_spacer" ng-class="seat.type" id="ui{{$parent.$index}}-{{$index}}" 
                        ng-dblclick="selectColumn($index)" ng-style="{'margin-left':seat.columnMargin}"
                        ng-click="selectSeat(seat, $parent.$index, $index)">
                        {{seat.uniqueIndex}}
                    </td>
                </tr>
            </table>

我在使用之前解析的json字符串是:

seats:"[[{"type":"reserve","price":9,"uniqueIndex":"0-0","row":0,"col":0,"columnMargin":0,"rowMargin":0,"$$hashKey":"object:327"},{"type":"reserve","price":9,"uniqueIndex":"0-1","row":0,"col":1,"columnMargin":0,"rowMargin":0,"$$hashKey":"object:328"}],[{"type":"general","price":9,"uniqueIndex":"1-0","row":1,"col":0,"columnMargin":0,"rowMargin":0,"$$hashKey":"object:333"},{"type":"general","price":9,"uniqueIndex":"1-1","row":1,"col":1,"columnMargin":0,"rowMargin":0,"$$hashKey":"object:334"}]]"

系统正在为我的第一次ng-repeat返回重复的转发器问题。试图使用“跟踪$ index”,但它导致无限循环。

任何帮助将不胜感激。我是Angular世界的新手。

0 个答案:

没有答案