0

I'm using the child routers in Durandal for tab control.

However whenever you change tab, it creates a history event. Again and again. It has made my "Close" button pointless because I cannot router.navigateBack() anymore (would need to many times).

Is there a way to navigate back beyond the current parent route, or make the child router create no history?

var childRouter = m_router
    .createChildRouter()
    .makeRelative({ moduleId: 'viewmodels/manage/bill/center', fromParent: true })
    .map([
        { route: ['contract', ''], moduleId: 'contract', title: 'Contracts', nav: true },
        { route: 'job', moduleId: 'job', title: 'Jobs', nav: true },
        { route: 'order', moduleId: 'order', title: 'Orders', nav: true }
    ]).buildNavigationModel();

Thanks.

Tim
  • 2,968
  • 5
  • 29
  • 55

1 Answers1

1

It sounds like what you want to do is just to not place an entry into history. You can do this like so -

router.navigate('your/hash/here', { replace: true, trigger: false });

When your child router is making a route change.

http://durandaljs.com/documentation/Using-The-Router.html#triggering-navigation

PW Kad
  • 14,953
  • 7
  • 49
  • 82