나는이 내 백본보기 중 하나에 대한 다음 코드를백본보기 이벤트는 기능을 수행하지 않는 것
class GD.Views.Result extends Backbone.View
template: JST['mobile/templates/result']
tagName: 'tr'
className: 'result'
events:
'click' : 'showDetail'
'click #favourite' : 'addFavourite(Favourite)'
'click #like' : 'addFavourite(Like)'
'click #dislike' : 'addFavourite(Dislike)'
render: ->
$(@el).html(@template(model: @model))
this
addFavourite: (type) ->
event.preventDefault()
attributes =
id: @model.id
type: type
cluster: @model.cluster
@collection.create attributes,
wait: true
success: @updateIcons
error: @handleError
showDetail: ->
...
updateIcons: ->
...
handleError: ->
...
그리고 내 콘솔에서이 오류 받고 있어요 :
을Uncaught Error: Method "addFavourite(Favourite)" does not exist
왜 이것이 AddFavourite 메서드가 아닌 showDetail 메서드에서 발생하는지 이해하지 못합니다. 어떤 이벤트에 대해서도 정의 된 인수가 필요한 메서드를 전달할 수 있습니까? 사전에 어떤 도움
많은 감사 (!)