system

  • module
can/view/stache/system  

A SystemJS and StealJS extension that allows stache templates as dependencies.

STACHE_MODULE_NAME!can/view/stache/system

Parameters

  1. STACHE_MODULE_NAME {moduleName}

    The module name of a stache template. This will typically be something like templates/stache.

Returns

{renderer(data, helpers)}

A renderer function that will render the template into a document fragment.

StealJS Use

With StealJS used from node_modules, CanJS will configure SystemJS so stache modules can be loaded by just placing a ! following a moduleName that ends with .stache like:

import todosStache from "todos.stache!"
todosStache([{name: "dishes"}]) //-> <documentFragment>

Specifying Dependencies

This plugin allows <can-import> elements that specify template dependencies:

<can-import from="components/my_tabs"/>
<can-import from="helpers/prettyDate"/>

<my-tabs>
  <my-panel title="{{prettyDate start}}">...</my-panel>
  <my-panel title="{{prettyDate end}}">...</my-panel>
</my-tabs>