Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4828

[Opinion] What is your prefered multi-line syntax style in HBS?

$
0
0

@sukima wrote:

I’ve seen a few different styles and I was wondering what others thought. Here are a two I personally flip between:

<AngleBracketComponent
    class="foobar"
    @fourSpaceIndent={{this.foo}}
    as |foo|/>
  <TwoSpaceIndent/>
  <p>Ending bracket stays on last line</p>
</AngleBracketComponent>

{{#curly-bracket-component
    class="foobar"
    fourSpaceIndent=this.foo
    as |foo|}}
  {{two-space-indent}}
  <p>Ending bracket stays on last line</p>
{{/curly-bracket-component}}
<AngleBracketComponent
  class="foobar"
  @twoSpaceIndent={{this.foo}}
  as |foo|
/>
  <TwoSpaceIndent/>
  <p>Ending bracket ends on next line</p>
</AngleBracketComponent>

{{#curly-bracket-component
  class="foobar"
  twoSpaceIndent=this.foo
  as |foo|
}}
  {{two-space-indent}}
  <p>Ending bracket ends on next line</p>
{{/curly-bracket-component}}

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4828

Trending Articles