Skip to content
This repository was archived by the owner on Mar 26, 2018. It is now read-only.
This repository was archived by the owner on Mar 26, 2018. It is now read-only.

Mustache templates don't render; they're just strings, not functions.  #309

@benshine

Description

@benshine

I created a new app using backbone-generator with --template-framework=mustache, then generated a view and tried to render it:
yo backbone cats --template-framework=mustache
yo backbone:view CatView

I changed the definition of render so that it doesn't try to look at a model, and removed the call to listen to the model in initialize, so I wouldn't need a model for this issue report. Now render is just:

render: function () {
    this.$el.html(this.template( { name: 'Fluffy' } );
}

In main.js, I created a single CatView and tried to render it:

 var catView = new Cats.Views.CatView({ el: '#theCat' });
 catView.render();

This fails, because this.template is just a string, not a function, so it can't be called.
I think we just need to add a call to Mustache.render; I'll see if I can get this fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions