JsRender Demos

Example Scenario: Accessing parent data.

Stepping up through the views (tree of nested rendered templates)
var model = {
    specialMessage: function(...) { ... },
    theater: "Rialto",
    movies: [ ... ]
}

{{for movies}}
    <tr>
        <td>'{{>title}}': showing at the '{{>#parent.parent.data.theater}}'</td>
TitleLanguages (+specialMessage)
Setting contextual template parameters, accessible in all nested contexts as ~nameOfParameter:
{{for movies ~theater=theater}}
    <tr>
        <td>'{{>title}}': showing at the '{{>~theater}}'</td>
TitleLanguages (+specialMessage)
Using the top-level data, accessible in all nested contexts as ~root:
{{for movies}}
    <tr>
        <td>'{{>title}}': showing at the '{{>~root.theater}}'</td>
TitleLanguages (+specialMessage)