5
我想向我的一個模板添加少量邏輯(請不要責怪我將邏輯放在視圖中的錯誤),並且難以獲得正確的hamlc語法。如何製作橫跨多行的混合咖啡封口?
我遍歷集合,並想跳過存在於另一個集合
元素直線上升的CoffeeScript會是什麼樣子:
for artwork in artworks
unless _.find(cart_items, (ci) ->
ci.id == artwork.product_code
alert 'artwork not in cart'
我想:
- for artwork in artworks
- unless _.find(cart_items, (ci) -> | # < multiline, right?
ci.id == artwork.product_code
- alert 'artwork not in cart'
,我得到一些hogwash約:
Block level too deep in line undefined
任何想法? TIA, 比利
在'我trying'部分,如果它HAML文件,或文件的CoffeeScript ?你在運行哪個口譯員? – asawyer
啊,對,謝謝。這是一個hamlc文件 - https://github.com/9elements/haml-coffee。我的代表是廢話,所以我不能添加hamlc標籤..;) – Billy
我以前沒見過這個,謝謝我會檢查出來。爲您添加了標籤。 – asawyer