When pager or a page does not find a matching sub-page for a route
a callback is called.
Either set pager.onNoMatch
or supply onNoMatch
to the page configuration with a function that takes 2 arguments: first the page and second the missing
route.
This makes it easy to identify missing pages for routes and take actions.
<div data-bind="page: {id: 'random', onNoMatch: randomFailed}"> <ul class="nav nav-tabs" data-bind="foreach: $page.children"> <li data-bind="css: {active: isVisible}"><a data-bind="text: getId(), page-href: getId()"></a></li> </ul> <div data-bind="foreach: newChildren"> <div data-bind="page: {id: childId}"> <span data-bind="text: childId"></span> </div> </div> </div>where
randomFailed:function (options) { var page = options.page; var route = options.route; viewModel.newChildren.push({ childId:route[0] }); page.showPage(route); }, newChildren:ko.observableArray([])