mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
23 lines
917 B
HTML
23 lines
917 B
HTML
<!-- Expects the data context to have a `template` property (the name of
|
|
the template to render) and an optional `data` property. If the `data`
|
|
property is not specified, then the parent data context will be used
|
|
instead. Uses the __dynamicWithDataContext template below to actually
|
|
render the template. -->
|
|
<template name="__dynamic">
|
|
{{checkContext}}
|
|
{{#if dataContextPresent}}
|
|
{{> __dynamicWithDataContext}}
|
|
{{else}}
|
|
{{! if there was no explicit 'data' argument, use the parent context}}
|
|
{{> __dynamicWithDataContext template=template data=..}}
|
|
{{/if}}
|
|
</template>
|
|
|
|
<!-- Expects the data context to have a `template` property (the name of
|
|
the template to render) and a `data` property, which can be falsey. -->
|
|
<template name="__dynamicWithDataContext">
|
|
{{#with chooseTemplate template}}
|
|
{{> .. ../data}} {{!-- The .. is evaluated inside {{#with ../data}} --}}
|
|
{{/with}}
|
|
</template>
|