Using the Backbone.js router to navigate through views modularized with require.js

前端 未结 8 933
别跟我提以往
别跟我提以往 2020-12-22 23:41

I am separating my views and router into separate files with require. I then have a main.js file that instantiates the router, and also renders my default view.

My r

8条回答
  •  庸人自扰
    2020-12-23 00:24

    For me, the solution with goTo function worked with a slight change

     Backbone.View.prototype.goTo = function (loc) {
          appRouter.navigate(loc, true);
        };
    

提交回复
热议问题