Files
meteor/packages/spacebars-tests/template_tests.html
Avital Oliver 599778a791 block helper calling syntax
notably, only applies when the block helper is a component
rather than a function. so this works for built-in block helpers
such as {{#if}}.
2013-10-04 22:21:58 -07:00

94 lines
1.9 KiB
HTML

<!-- convenient templates to use in different tests -->
<template name="spacebars_template_test_aaa">
aaa
</template>
<template name="spacebars_template_test_bbb">
bbb
</template>
<template name="spacebars_template_test_bracketed_this">
[{{this}}]
</template>
<template name="spacebars_template_test_content">
{{> content}}
</template>
<template name="spacebars_template_test_elsecontent">
{{> elseContent}}
</template>
<!-- -->
<template name="spacebars_template_test_simple_helper">
{{foo bar}}
</template>
<template name="spacebars_template_test_dynamic_template">
{{> foo}}
</template>
<template name="spacebars_template_test_interpolate_attribute">
<div class="aaa{{foo bar}}zzz"></div>
</template>
<template name="spacebars_template_test_dynamic_attrs">
<span {{{attrs1}}} {{{attrs2}}} {{k}}={{v}} {{x}} {{nonexistent}}>hi</span>
</template>
<template name="spacebars_template_test_triple">
{{{html}}}
</template>
<template name="spacebars_template_test_inclusion_args">
{{> foo bar}}
</template>
<template name="spacebars_template_test_inclusion_args2">
{{> foo bar baz}}
</template>
<template name="spacebars_template_test_inclusion_args3">
{{> foo bar q=baz}}
</template>
<template name="spacebars_template_test_inclusion_dotted_args">
{{> foo bar.baz}}
</template>
<template name="spacebars_template_test_block_helper">
{{#foo}}
bar
{{else}}
baz
{{/foo}}
</template>
<template name="spacebars_template_test_block_helper_function_one_string_arg">
{{#foo "bar"}}
content
{{/foo}}
</template>
<template name="spacebars_template_test_block_helper_function_one_helper_arg">
{{#foo bar}}
content
{{/foo}}
</template>
<template name="spacebars_template_test_block_helper_component_one_helper_arg">
{{#if bar}}
content
{{/if}}
</template>
<template name="spacebars_template_test_block_helper_component_three_helper_args">
{{#if equals bar_or_baz "bar"}}
content
{{/if}}
</template>