machty / emblem.js

Emblem.js - Ember-friendly, indented syntax alternative for Handlebars.js
http://emblemjs.com
MIT License
1.04k stars 81 forks source link

Mulit-line `as |item|` not supported #306

Closed samdemaeyer closed 6 years ago

samdemaeyer commented 6 years ago

Either its not documented, or its just not supported. This works fine:

= my-component attributes=attribute conditions=conditions model=model size=size as |item|
  = item

These will break:

= my-component [
    attributes=attributes
    conditions=conditions
    model=model
    size=size
    as |item| ]
      = item

= my-component [
    attributes=attributes
    conditions=conditions
    model=model
    size=size ] as |item|
      = item

= my-component [
    attributes=attributes
    conditions=conditions
    model=model
    size=size as ] |item|
      = item

= my-component [
    attributes=attributes
    conditions=conditions
    model=model
    size=size ]
    as |item|
      = item
thec0keman commented 6 years ago

I think this is a combination of

It can work a few ways:

= my-component [
    attributes=attributes
    conditions=conditions
    model=model
    size=size 
] as |item|
    = item

Example (This example actually has multiple indention of = item, but it could be single and still work)

= my-component [
    attributes=attributes
    conditions=conditions
    model=model
    size=size ] as |item|
    = item

Example

samdemaeyer commented 6 years ago

Ah .. I see .. its not because of the as |item| that the build error occurs, its because of the wrong indentation of = item 🙄 My bad, thanks for the info @thec0keman! Closing issue now 👍