partial (partialName) public
The partial
helper renders another template without changing the template context:
{{foo}} {{partial "nav"}}
The above example template will render a template named "-nav", which has the same context as the parent template it's rendered into, so if the "-nav" template also referenced {{foo}}
, it would print the same thing as the {{foo}}
in the above example.
If a "-nav" template isn't found, the partial
helper will fall back to a template named "nav".
Bound template names
The parameter supplied to partial
can also be a path to a property containing a template name, e.g.:
{{partial someTemplateName}}
The above example will look up the value of someTemplateName
on the template context (e.g. a controller) and use that value as the name of the template to render. If the resolved value is falsy, nothing will be rendered. If someTemplateName
changes, the partial will be re-rendered using the new template name.
Parameters:
-
partialName
String
- The name of the template to render minus the leading underscore.
Please login to continue.