I get a "route not found" when I try to use child routing. To cover my bases, here's how application routing is designed.
The main.js file contains routing for top navigation and runs as -
router.map([ { route: 'LOC', moduleId: 'LOC', title: 'LC', nav: 3 } ]);
I map the routes for the page footer as -
router.map('About', 'About', 'About', false); router.map('Help', 'Help', 'Help', false);
When the user clicks on the “LOC” route created above, the left navigator is displayed on this screen. This view uses child routing and is configured as -
var childRouter = router.createChildRouter() .makeRelative({ moduleId: 'viewmodels/', fromParent: true }).map([ { route: '*LCClientSearch', moduleId: 'LCClientSearch', title: 'Create LC', type: 'intro', hash: '#LCClientSearch', nav: true }, { route: '*LCPending', moduleId: 'LCPending', title: 'Pending LC', type: 'intro', hash: '#LCPending', nav: true } ]).buildNavigationModel();
LOC by default points to the LCClientSearch route and displays it correctly initially, HOWEVER, none of this happens. When a user clicks on LCClientSearh or LCPending, I get a "route not found" error.
LOC -
<div class="span2 well"> <ul class="nav nav-list"> <li class="nav-header">Availability</li> <li data-bind="css: { active: isActive }"> <a data-bind="attr: { href: hash }, text: title"></a> </li> <li class="nav-header">Manual Post</li> <li data-bind="css: { active: isActive }"> <a data-bind="attr: { href: hash }, text: title"></a> </li> </ul> </div>
Why am I not getting the route not found?