I'm using require.js with Backbone in ordrer to load my differents views.
In order to define the view I'm using this piece of script that is launched by my Router:
var view = require([
'hbs!tpl/'+name,
'views/'+name,
data.path
], function(Tpl,module,data){
options.template = Tpl;
options.data = data;
return new module(options);
});
The Backbone view receive the usefull options like the compiled template and the Model definition.
Is there a way to remove the script added by Require.js into the head tag when I remove my Backbone view ?