I am trying to use the durandal router, but I have these 2 errors on my console:
Uncaught Error: Script error for: durandal/router
and of course this: Failed to load resource: the server responded with a status of 404 (Not Found)
which is very self explanatory I know, but I dont find any error on the code, or the files structure.
requirejs.config({
paths: {
'text': '../Scripts/text',
'durandal': '../Scripts/durandal',
'plugins': '../Scripts/durandal/plugins',
'transitions': '../Scripts/durandal/transitions'
}
});
define('jquery', [], function () { return jQuery; });
define('knockout', [], function () { return ko; });
define(['durandal/system', 'durandal/app', 'durandal/viewLocator', 'durandal/plugins/router', 'services/logger'], function (system, app, viewLocator, router, logger) {
app.title = 'My App';
//specify which plugins to install and their configuration
app.configurePlugins({
router: true,
dialog: true,
widget: {
kinds: ['expander']
}
});
system.debug(true);
app.start().then(function () {
router.useConvention();
viewLocator.useConvention();
app.setRoot('viewmodels/shell');
router.handleInvalidRoute = function (route, params) {
logger.logError('No route found', route, 'main', true);
};
});
});
shell.js
define(['durandal/system', 'services/logger', 'durandal/plugins/router','config'],
function(system,logger, router, config) {
var shell ={
activate: activate,
router: router
};
return shell;
function activate(){
logger.log('CodeCamper Jumpstart Loaded!',
null,
system.getModuleId(shell),
true)
router.map(config.routes);
return router.activate(config.startModule);
}
}
);
vs structure