maccman / sprockets-commonjs

Adds CommonJS support to Sprockets
178 stars 66 forks source link

JST templating shortcut #23

Closed mulderp closed 11 years ago

mulderp commented 11 years ago

I am note sure if this is an issue with CommonJS or Sprockets. I would like to use JST for a template within a widget module:

var LoginView = Backbone.View.extend({

  template: JST["templates/login"],

  initialize: function() {
    console.log("join");
  }

});

The JST is not found.

mulderp commented 11 years ago

I will try with:

function(template, data) {
  return HandlebarsTemplates[template](data);
};
alduro commented 10 years ago

Have you solved this ? I'm having the same issue. JST cannot be accessed from within Backbone.View.