1

yeoman init backbone:view input

This generates two files: app/scripts/templates/input.ejs and app/scripts/views/input-view.js

How do instantiate this view from within the application?

RSK
  • 17,210
  • 13
  • 54
  • 74
Leila Hamon
  • 2,505
  • 7
  • 24
  • 32

1 Answers1

0

Please try with latest backbone genearator with yeoman 1.0beta. We have made lot of improvements on it including Precompiling ejs templates. You don't want to worry about templates, yeoman will precompile it you.

You can instantiate the InputView as you want and just use the template method to work with ejs. A sample code is provided below.

Todo.Views.InputView = Backbone.View.extend({

    template: JST['app/scripts/templates/input.ejs'],

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

});
RSK
  • 17,210
  • 13
  • 54
  • 74