Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 860ea9c074
Fetching contributors…

Cannot retrieve contributors at this time

62 lines (46 sloc) 1.594 kb


mustache-javascriptmvc brings the power of the Mustache templating language and its superset handlebars.js to javascriptmvc.

Checkout the official Handlebars docs site at for syntax.

Note handlebars.js defines helpers by registering them with the Handlebars prototype. Although javascriptmvc supports passing handlers into the view/render calls, mustache-javascriptmvc does not currently pass them on to handlebars.


./steal/js steal/getjs mustache

Alternatively, you can grab the code from the Github repository:

git clone git:// mustache

Configure it to load for all .mustache files in your stealconfig.js:

    map: {
        "*": {
            'jquery/jquery.js' : "jquery",
            "can/util/util.js": "can/util/jquery/jquery.js"
    paths: {
        "jquery": "can/util/jquery/jquery.1.8.1.js"
    ext: {
        js: "js",
        css: "css",
        less: "steal/less/less.js",
        coffee: "steal/coffee/coffee.js",
        mustache: "mustache/mustache.js"

Create some .mustache files and use them normally:

steal("//views/template.mustache",function(template) {
    $("#elem").html(template({ variable: "Value" }))

Using "hookupModel" and "hookupView":

<script type="text/mustache" id="subView">
    <div {{{hookupModel}}}></div>

<script type="text/mustache" id="mainView">
    {{#each this}}
        {{{hookupView "subView" this}}}
Jump to Line
Something went wrong with that request. Please try again.