Skip to content

Instantly share code, notes, and snippets.

@spullara
Created February 22, 2012 04:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spullara/1881261 to your computer and use it in GitHub Desktop.
Save spullara/1881261 to your computer and use it in GitHub Desktop.
super.mustache:
<div>
{{#list}}
<span>{{item}}</span>
{{/list}}
</div>
sub.mustache (not the same):
{{<super}}
{{#list}}
<span>{{item}}</span>
{{/list}}
{{/super}}
sub.mustache (the same):
{{<super}}
{{#list}}
{{#list}}
<span>{{item}}</span>
{{/list}}
{{/list}}
{{/super}}
Using $ instead to replace with the same content:
super.mustache:
<div>
{{$list}}
<span>{{item}}</span>
{{/list}}
</div>
sub.mustache:
{{<super}}
{{$list}}
<span>{{item}}</span>
{{/list}}
{{/super}}
Using ^ could make sense -- this works as long as list is undefined:
super.mustache:
<div>
{{^list}}
<span>{{item}}</span>
{{/list}}
</div>
sub.mustache:
{{<super}}
{{^list}}
<span>{{item}}</span>
{{/list}}
{{/super}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment