Using the Backbone.js router to navigate through views modularized with require.js
问题 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 router has view ('View/:id') and edit ('Edit/:id') as routes. In main.js, when I instantiate the router, I can hardcode router.navigate('View/1', true) and the navigation works fine. In my view file, when I click on the edit link, I want to call router.navigate('View/' + id, true), but I'm not sure how I should do this. I've had