0
我有骨气观点与继承:无法呈现骨干视图
class App.Views.User.Base extends Backbone.View
el: '#main'
initialize: ->
events:
'click .save': 'save'
render: ->
@$el.html @template user: @model
@
class App.Views.User.Registration extends App.Views.User.Base
template: JST['template/users/registration']
save: ->
if not @model.expired()
@model.save {},
error: (model, response) ->
console.log response.responseText
当我试图使这个:
(new FancySurvey.Views.User.Registration(model: model)).render()
我得到了错误:
Property 'template' of object #<Registration> is not a function
什么可能是问题?由于
什么是'@ template'当'render'被调用? –
@ muistooshort,它只是未定义 – megas
而'JST ['template/users/registration']'是模板函数吗? –