This repository has been archived on 2023-12-10. You can view files and clone it, but cannot push or open issues or pull requests.
Sublime-Handlebars/test/template.handlebars

117 lines
3.0 KiB
Handlebars
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<h2 class="{{class}}">Test</h2>
{{#if showThis}}
<p>Testing <strong>{{{testToken}}}</strong> {{#if otherCondition}}<strong>"{{otherTestToken}}"</strong> {{/if}}</p>
{{else}}
<p>'Thus spoke Zarathustra' "ORLY?"</p>
{{/if}}
<div class="{{class}}{{#if shouldBeRed}} red{{/if}}">
<custom-element>Test</custom-element>
<{{tag}} attr="asdf">asdf</{{tag}}>
<input name="{{noCaps name}}" placeholder="{{#unless placeholder}}{{name}}{{else}}{{placeholder}}{{/unless}}" type="text"/>
{{!-- parent context --}}
{{> template arg=../value}}
{{../value}}
</div>
{{> yayPartial customData='FoolBar'}}
{{!< GhostStyleExtend}}
{{log "Look at me!"}}
{{! advanced helper parameters }}
{{customHelper "test1" 'test2' 32 true object.value}}
{{{link "See more..." href=story.url class="story" foo='bar'}}}
{{customHelper 'test-single-quote-escaped\''}}
{{customHelper "test-double-quote-escaped\""}}
{{! parameters in block vs inline helpers }}
{{#select a="aa" b="bb" c="cc"}}{{/select}}
{{select a="aa" b="bb" c="cc"}}
{{! FIXME: subexpressions }}
{{! this could be improved }}
{{outer-helper (inner-helper 'abc') 'def'}}
{{! FIXME: named block parameters }}
{{! this could be improved }}
{{#each users as |user userId|}}
{{#each user.book as |book bookId|}}
User Id: {{userId}} Book Id: {{bookId}}
{{/each}}
{{/each}}
{{! FIXME: array notation }}
{{! this could be improved }}
{{#each articles.[10].[#comments]}}
<h1>{{subject}}</h1>
<div>
{{body}}
</div>
{{/each}}
<p>Not that interesting.</p>
{{! <p>Even less interesting.}} <p>No comment.</p>
{{!-- <p>Marginally less interesting. {{#if otherCondition}}<strong>"{{otherTestToken}}"</strong> {{/if}}</p> --}} <p>Nothing to see here.</p>
{{!-- <p>Marginally less interesting. {{{testToken}}}</p> --}} <p>Move along.</p>
{{! <!-- <h2 class="{{class}}">Test</h2> --> }}
<!-- {{! <h2 class="{{class}}">Test</h2> }} -->
{{/if}}
{{! inline attributes }}
<input type="checkbox" id="medication_taken" {{#if medication_taken}}checked{{/if}}>
{{! Ember ArrayController implicit each loop }}
<ul>
{{#each}}
<li>{{name}} by {{artist}}</li>
{{/each}}
</ul>
{{! with ... as }}
{{#with foo as bar}}
<li>{{name}} by {{artist}}</li>
{{/with}}
{{! else if }}
{{#if condition}}
<p>First</p>
{{else if alternate}}
<p>Second</p>
{{else if (sub-exp this.message)}}
<p>Third</p>
{{/if}}
{{#x-card onsubmit=attrs.onsubmit title='Login to Peepchat' buttonText='Login'}}
<div class="row">
{{x-input
value=model.email
errors=validations.attrs.model.email.messages
classNames='col s12'
type='email'
label='Username'}}
</div>
<div class="row">
{{x-input
value=model.password
errors=validations.attrs.model.password.messages
classNames='col s12'
type='password'
label='Password'}}
</div>
{{/x-card}}
{{$x "foo." bar}}
{{!-- con😺 --}}
{{some-component name=(concat firstName " " lastName)}}
{{concat prop1 ' ' prop2}}
{{! partial block }}
{{#> myPartial }}
Failover content
{{/myPartial}}
{{!-- Ember component path --}}
{{#some-folder/some-path}}{{/some-folder/some-path}}