2013-07-10 2 views
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 

Что может быть проблемой? Благодаря

+0

Что такое '@ template' когда' render' вызывается? –

+0

@muistooshort, это просто не определено – megas

+1

И 'JST ['template/users/registration']' является функцией шаблона? –

ответ

0

Проблема был с ложным путем к файлу шаблон, в моем случае это должно быть

class App.Views.User.Registration extends App.Views.User.Base 
    template: JST['users/registration'] 
    ... 
Смежные вопросы