在handlebars.js循环内部循环

时间:2015-05-02 07:13:35

标签: javascript jquery handlebars.js

我正在使用handlebars.js。我有一个飞行循环.LegsOut我真的只使用"第一个"和#34;最后" flight.LegsOut元素。但是在循环内部我有一个模态弹出窗口 - 标记 - "下拉弹出窗口"。弹出窗口将显示所有flight.LegsOut元素的数据。但弹出窗口放在"最后一个"循环(用于css放置原因)。所以我的问题是:如何在" last"内部完成整个Flight.LegsOut的循环。 flight.LegsOut是为了在模态弹出框中显示数据 - 标记为"下拉弹出框" ?

{{#each Flight.LegsOut}}
                        {{#if @@first}}
                        <figure class="srbl-img">
                            <img src="/content/images/airline/{{Carrier}}.png" />
                        </figure>{{/if}}

                        {{#if @@last}}
                        <span class="srbl-col2">
                            <font class="fcc-tab">{{IATAFrom}} </font>
                            <font class="fcc-right">
                                {{ time DepartureDateTime }}
                                <br>
                                Rome
                            </font>
                        </span>
                        <span class="srbl-col3">
                            {{ readableTime ../../Flight.TravelTimeOut}}
                            <br>
                            <font class="green">
                                {{ leglength ../../Flight.LegsOut}} <a href="#"><img alt="" src="/content/images/package/info-icon.png"></a>
                                <!-- dropdown popup -->
                                <div class="popup-tab">
                                    <span class="arrow-indicate"><img alt="" src="/content/images/package/top-indecate.png"></span>
                                    <div class="popup-innertab">
                                        <div class="popup-left">
                                            <h3>Airport</h3>
                                            <p>XXX (Milano)</p>
                                        </div>
                                        <div class="popup-right">
                                            <h3>Waiting time</h3>
                                            <p>1h 22m</p>
                                        </div>
                                        <div class="clear"></div>
                                    </div>
                                </div>
                                <!-- dropdown popup -->
                            </font>
                        </span>
                        <span class="srbl-col4">
                            <font class="fcc-tab">
                                <strong>{{IATATo}}</strong><br>
                                Iasi
                            </font>
                            <font class="fcc-right">
                                {{ time ArrivalDateTime }}

                            </font>
                        </span>
                        <div class="clear"></div>
                    {{/if}}
{{/each}}

1 个答案:

答案 0 :(得分:0)

我不确定我完全理解这个问题,如何:

= 'facebook' limit 1
1 row in set (6 min 23.37 sec)