Background
I have a long list of models and views made using backbone.js - but not all users will open all kinds. I use require.js to load JavaScripts files and templates.
What i have now
I have a router that knows about all the views. Since the router knows this, all views, models, and templates are loaded at startup - it also loads randomly viewed views.
Problem
How can I use require.js to load JavaScripts when necessary? Not in the initial launch, but when the user first opens the view.
UPDATE Now I can get this work to comment in response below.
In the router, I have a route requirement:
require(["yourmodule"], function(MyModule){
user920041
source share