Backbone.js: Router callback not reached

前端 未结 1 852
攒了一身酷
攒了一身酷 2021-01-29 03:11

I\'m having trouble getting a simple App example to route. I\'m using the backbone-on-rails gem.

Here\'s my App.js.coffee:

    window.App =
      Models:         


        
相关标签:
1条回答
  • 2021-01-29 03:25

    Looks like you just need to call Backbone.history.start rather than simply reference it. This just references the function:

    Backbone.history.start
    

    This calls it:

    Backbone.history.start()
    

    The function-calling parentheses are only optional when you supply some arguments.

    Demo: http://jsfiddle.net/ambiguous/hUZUV/

    0 讨论(0)
提交回复
热议问题