So I have this simple require:
require(['app/'+url,'dojo/text!content/'+url], function(module,template){
if(module.init){
module.init({
container: panel,
containerId: 'contentTabs_' + idOp,
template: template
});
}
});
But the template might not be there (sometimes it does). So whatever happens I’d like my require callback to be executed.
What is the AMD way to do this?
Thanks guys.
Instead of using
dojo/text!, write your own plugin:foo/maybemust resolve to an object with aload : function (id, require, callback)member.You can use an XHR call to fetch the resource and resolve to
undefinedon a 404 error.