xecutioner
xecutioner

Reputation: 311

Cannot define two events in backbone view

I had this working code with one event in backbone but now I need to have two events defined. But I am having ExecJsProgramError. I would appreciate if someone could tell me what I am doing wrong in the following code?

     class Hcm.Views.GlobalHeader extends Backbone.View
      template: JST["backbone/templates/global/header"]
      id: "header"

      events: ->
        "submit #sign-in": "update" 
        "click .fb-login": "login_with_facebook"

      render: ->
        $(@el).html(@template())
        return this

      login_with_facebook: (e)  ->
       alert 'ghanta prajeep'

Upvotes: 1

Views: 34

Answers (1)

xecutioner
xecutioner

Reputation: 311

    events:
     "click a#showlogin": "showLogin"
     "click input#login": "login"

So this is what I needed to do.

Upvotes: 1

Related Questions