eco

    3熱度

    2回答

    Supose我有這個簡單但還算嵌套生態模板移除不必要的空格: <div class="example"> <% for thing, i in @things: %> <div class="nested"> <% if i % 2 == 0: %> This block is fairly nested. <% end %> </

    20熱度

    2回答

    是否可以使用eco模板引擎獲取當前循環索引? 例如在Jinja2的,你可以做 {% for var in array %} {{ loop.index0 }} {% endfor %} 如果不是有沒有的索引處獲得的更地道的方式?

    0熱度

    1回答

    在我的模板中,我必須將this.name和this.gravatar訪問我的用戶模型數據屬性。 如果我沒有,模板嘗試呈現時我會收到錯誤消息。一切正常,但我沒有看到他們提出這個問題的任何例子。在模板中。 我的骨幹網查看: Class MyApp.Views.Header extends Backbone.View template: JST['header'] initiali

    0熱度

    1回答

    如何使用If語句指定在docpad.coffee文件中定義的變量。 我想要做這樣的事情: <% if sponsor.type == 'Gold': %> <li class="sponsor-item gold" itemscope itemtype="http://schema.org/Organization"> <a href="<%= sponsor.url %>" clas

    3熱度

    1回答

    我在我的Rails應用程序中使用了骨架和生態模板。我的模板有以下代碼: <% @collection.each (model)-> %> <% console.log model.get('name') %> <p><%= model.get('name') %></p> <p><%= model.get('description') %></p> <% e

    0熱度

    1回答

    我試圖使用嵌套,如果在生態模板。這裏是我的代碼 <% for document in @getCollection('posts').toJSON()[@[email protected]]: %> <% if true %> <p> <%= new Date(document.date.toDateString()).getTime() <= new D

    0熱度

    1回答

    我有一個簡單的場景,我返回帶有Rails後端的嵌套對象的JSON。我無法訪問嵌套對象的屬性。 例JSON: [{ category_id: 2, id: 34, name: "red", category: { name: "color" } }, { category_id: 2, id: 35, na

    0熱度

    3回答

    具體的問題:這個代碼工作中的骨幹模板index.jst.eco,但它不能在index.jst.ejs工作 <ui> <% for entry in @entries.models: %> <li> <%= entry.get('name') %></li> <% end %> </ui> 我想知道爲什麼(即如何解決它的ejs),並且更一般地,是否有關於如何在ejs模板中編寫代碼的全

    2熱度

    1回答

    我在生產環境中遇到了涉及圖像的輕微問題。圖像文件是使用imagemin生成的,我最終得到了/ images/..文件 - 這非常好,但我不知道如何在CoffeeScript中引用它們。特別是在我使用BackboneJS的ECO模板中。 一切工作正常在CSS - 指南針似乎照顧投入正確的網址。但是沒有幫助我可以使用(或者我不知道如何)來引用該圖片網址。 所以一個簡單的 <img src="image

    0熱度

    1回答

    運行的代碼,我有以下代碼中index.eco <% for drawing, index in @drawings: %> <li class="span4 well"> <div style="margin-bottom: 10px;"> <h3 style="margin-top: 0;"><%=drawing.name%></h3> </div>