Backbone Views + deferred handlebars template loading
问题 I am trying to load handlebars templates and rendering them via deferred objects / promises, but when i refactored the code by putting in deferreds , errors are occurring: My view is as follows: var indexView = Backbone.View.extend({ initialize: function (options) { this.options = options || {}; manager.getTemplate('path/to/template').then(function(tpl){ // tpl is a handlebar compiled template,returned by getTemplate this.template = tpl; this.render(); // that causes // Uncaught TypeError: