Skip to content

Instantly share code, notes, and snippets.

@ryankshaw
Forked from iammerrick/gist:7682950
Created November 27, 2013 20:58
Show Gist options
  • Save ryankshaw/7683094 to your computer and use it in GitHub Desktop.
Save ryankshaw/7683094 to your computer and use it in GitHub Desktop.
<span
ng-click="add()"
class="icon icon__plus"
>Hello World!</span>
@ryankshaw
Copy link
Author

in cases where whitespace matters, I'll do what you did or just all on the same line: <span ...>Hello World!</span> (especially where there is only a couple attributes).

if not, I'd do:

<span
  ng-click="add()"
  class="icon icon__plus"
>
  Hello World!
</span>

I'm not real strict about any of it, I just don't want to have lines that are crazy long and by having the ">" on the same indentation level as the "<" and "</" makes things easer to read and reason about, IMO

@iammerrick
Copy link

Great! Thanks man! I will hence forth write shaw style markup.

@ryanflorence
Copy link

@iammerrick just treat the final > the same as you always have:

<p>small text</p>
<p>
  lots of text
  that you want inside
</p>

<div
  ng-click="add()"
  class="icon"
  ng-whatev="dude"
>small text</div>

<div
  ng-click="add()"
  class="icon"
  ng-whatev="dude"
>
  lots of text
  that you want inside
</div>

@ryanflorence
Copy link

@ryankshaw I don't know if you remember this, but you and I spent like an hour deciding how to do this, glad to see we both still do it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment