How can I not to load any module or page when I start the durandal app?
I want to load the page content from server side programme (PHP & MySQL) into
<div id="applicationHost">..</div>
only then the durandal app will follow. is it possible?
index.html,
<!DOCTYPE html>
<html>
<head>
<title>Durandal</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="lib/bootstrap/css/bootstrap.css" />
<link rel="stylesheet" href="lib/bootstrap/css/bootstrap-responsive.css" />
<link rel="stylesheet" href="lib/durandal/css/durandal.css" />
<script src="lib/require/require.js" data-main="app/main"></script>
</head>
<body>
<div>
<a href="#/first">first</a>
<a href="#/second">second</a>
<a href="#/user/123">user 123</a>
</div>
<div id="applicationHost">
// load the page content from server side.
</div>
</body>
</html>
shell.js
define(['plugins/router', 'durandal/system'], function (router, system) {
return {
router: router,
activate: function () {
router.makeRelative({moduleId: 'viewmodels'});
router.map([
/*
{
route: '',
title:'Welcome',
moduleId: '/first',
nav: true
},
*/
{
route: 'first',
title:'Welcome',
moduleId: '/first',
nav: true
},
{
route: 'second',
moduleId: '/second',
nav: true
},
{
route: 'user/:id',
moduleId: '/second'
}
]);
//builds an observable model from the
//mapping to bind your UI to
router.buildNavigationModel();
//sets up conventional mapping for
//unrecognized routes
router.mapUnknownRoutes('viewmodels/not-found', 'not-found');
system.log("shell started.");
//return router.activate({ pushState: true });
return router.activate();
}
};
});
I get an error for commenting out this from the route,
{
route: '',
title:'Welcome',
moduleId: '/first',
nav: true
},
error,
system.js (line 80)
Error: Failed to load routed module (viewmodels/viewmodels/not-found). Details: Script error for: viewmodels/viewmodels/not-found http://requirejs.org/docs/errors.html#scripterror
exception = new Error(error);