Visit this group at http://groups.google.com/group/backbone-marionette?hl=en.--
You received this message because you are subscribed to the Google Groups "Backbone.Marionette" group.
To post to this group, send email to backbone-...@googlegroups.com.
To unsubscribe from this group, send email to backbone-marion...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/backbone-marionette/-/J8VU8f1PLRwJ.
Can you not use something like this:
define("module.fetcher", [
'App.Auth',
'App.Router',
'require' // this is a special built-in requireJS module that allows for on-demand loading
],
function(auth, router, require) {
var fetchedModule = null,
hasRights = false;
// some code that figures out if the user has rights to the requested route
if (hasRights) {
require('moduleName', function(module) {
fetchedModule = module;
}
}
return fetchedModule;
}
--
You received this message because you are subscribed to the Google Groups "Backbone.Marionette" group.
To post to this group, send email to backbone-...@googlegroups.com.
To unsubscribe from this group, send email to backbone-marion...@googlegroups.com.
Visit this group at http://groups.google.com/group/backbone-marionette?hl=en.
To view this discussion on the web visit https://groups.google.com/d/msg/backbone-marionette/-/UClsKsSlb58J.
define("module.fetcher", [
'jquery',
'App.Auth',
'App.Router',
'require' // this is a special built-in requireJS module that allows for on-demand loading
],
function($, auth, router, require) {
var def = $.Deferred(),
hasRights = false;
// some code that figures out if the user has rights to the requested route
if (hasRights) {
require(["moduleName"], function(module) {
def.resolve(module);
}
}
return def;
}
To unsubscribe from this group, send email to backbone-marionette+unsub...@googlegroups.com.
To unsubscribe from this group, send email to backbone-marion...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/backbone-marionette/-/kFhez0DrTFgJ.
+1000 this sounds great! thank you! :)
To unsubscribe from this group, send email to backbone-marionette+unsubscribe...@googlegroups.com.
Visit this group at http://groups.google.com/group/backbone-marionette?hl=en.
To view this discussion on the web visit https://groups.google.com/d/msg/backbone-marionette/-/UClsKsSlb58J.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "Backbone.Marionette" group.
To post to this group, send email to backbone-...@googlegroups.com.
To unsubscribe from this group, send email to backbone-marionette+unsub...@googlegroups.com.
Visit this group at http://groups.google.com/group/backbone-marionette?hl=en.
To view this discussion on the web visit https://groups.google.com/d/msg/backbone-marionette/-/kFhez0DrTFgJ.
--
You received this message because you are subscribed to the Google Groups "Backbone.Marionette" group.
To post to this group, send email to backbone-...@googlegroups.com.
To unsubscribe from this group, send email to backbone-marionette+unsub...@googlegroups.com.
Visit this group at http://groups.google.com/group/backbone-marionette?hl=en.
--
You received this message because you are subscribed to the Google Groups "Backbone.Marionette" group.
To post to this group, send email to backbone-...@googlegroups.com.
To unsubscribe from this group, send email to backbone-marionette+unsub...@googlegroups.com.
Visit this group at http://groups.google.com/group/backbone-marionette?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "Backbone.Marionette" group.
To post to this group, send email to backbone-...@googlegroups.com.
To unsubscribe from this group, send email to backbone-marionette+unsub...@googlegroups.com.
Visit this group at http://groups.google.com/group/backbone-marionette?hl=en.