Marionette.js appRouter not firing on app start

前端 未结 1 1530
暗喜
暗喜 2021-01-22 23:59

I am currently integrating Marionette into an existing Backbone application.

I have an existing Backbone router in place, but am trying to implement a Marionette.AppRout

相关标签:
1条回答
  • 2021-01-23 00:41

    Did you call Backbone.history.start() after creating your router instance? If not, you need to do that. Routers won't run until this is called in your app, and you can't call this until at least one route has been instantiated. I usually do this:

    
    TestApp.on("initialize:after", function(){
      if (Backbone.history){ Backbone.history.start(); }
    });
    

    hth

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