Navigate to parent route + bower component questions

22 views
Skip to first unread message

Eric

unread,
Jun 7, 2015, 12:19:30 AM6/7/15
to duran...@googlegroups.com
Hello,

  New durandal user here (about a month).

  
 1) Navigate to parent route:

  I'm working on a application that use a hierarchical / drill down type of navigation.

  In the Durandal router API, there is a "navigateBack" call that works with history but no predefined call to navigate back to parent route.

  "activeInstruction" seems to contain some of the needed data but it looks like this imply some "manual" reconstruction of the route url. I'm not sure how to use the data to implement the missing functionnality in a generic way.

  Another dev, that had configured the child routes, seem to have encountered the same problem as I noticed extra parameters that where added (in child route configuration) to try to pass the parent route info to child routes.
 
  I will give this solution a second look but I wanted to double-check here if there woulld be a better solution.

  Any hint?

 2) We are using Durandal through the bower component and we have a found a bug that could be fixed by using a more recent version of Knockout (3.2).
     Forking could be an option but is there any plan regarding the update of the bower component or using the source directly from Durandal is the way to go?


Thanks in advance,

Eric

Garry Taylor

unread,
Jun 21, 2015, 8:27:25 AM6/21/15
to duran...@googlegroups.com
Sorry if I am not understanding your question correctly but do you mean you want the use to navigate to the parent router when they click the back button. Even if they are n levels deep into child routing?

I believe the only way to do this is to override the router.navigate back. Checking if the routers has a parent router (as constructed within your child router setup) and navigate here.
The Router/history modules are a little overwhelming at first but it should be possible.

Eric

unread,
Jun 21, 2015, 10:35:13 AM6/21/15
to duran...@googlegroups.com

I guess you confirm me that there is no default implementation of this behavior and that I will have to do it.

Thanks!


Reply all
Reply to author
Forward
0 new messages