8

I'm developing Ember.js application using Emblem.js as template precompiler.

I have an ember component with a lot of bindings

= delivery-map deliveryZones=deliveryZones selectedZone=selectedZone drawingZone=drawingZone isPolygonEditing=isPolygonEditing

Not very good looking... So I want to make it look more like this:

= delivery-map
  deliveryZones=deliveryZones
  selectedZone=selectedZone
  drawingZone=drawingZone
  isPolygonEditing=isPolygonEditing

Is there a way to do something like this in Emblem.js?

Tikhon Belousko
  • 767
  • 1
  • 9
  • 26

1 Answers1

9

yes, now you can do

delivery-map [
  deliveryZones=deliveryZones
  selectedZone=selectedZone
  drawingZone=drawingZone
  isPolygonEditing=isPolygonEditing ]
RichardJohnn
  • 654
  • 9
  • 24
  • 3
    I have noticed it doesn't work with views, for example `view "nice" [ (\n) flavor = "delicious" (\n) size = "just_right" (\n) ]` where the (\n) are where new lines are – RichardJohnn Nov 17 '14 at 16:48
  • What version of emblem was this feature added? I'm still on 0.3.18, tried to upgrade to 0.4.0 and 0.5.0, but our app is still using EAK and ember 1.8.1, handlerbars 1.3.x, so quite a lot of dependencies to deal with. The [ ] feature doesn't seem to work on ember components in 0.3.18 – Kevin Jhangiani Apr 03 '15 at 22:44
  • This actually doesn't seem to work even with emblem 0.5 and ember-cli 1.11 either, there's a pull request for it but it's still pending. Does it work on components? helpers? I can't get it to compile on anything – Kevin Jhangiani Jun 08 '15 at 21:46
  • 1
    Try your example out in http://bantic.github.io/try-emblem/ -- You will find emblem is quite picky about the details. For instance @RichardJohnn 's example will work if you put "nice" inside square brackets on the 2nd line, and eliminate blank spaces... – shaunc Jul 25 '15 at 06:53