0
votes

I have two routers, each with one route. The first router, lets call it the page router, handles the route: "" by drawing the page furniture (header, footer, etc.). The second router, the module router, deals with a hash route, ":program/config" by showing in the middle of the page the configuration for the chosen program.

The user starts the app by going to the home page: http://host/service/home.html. This causes the page router to draw the home page. The user chooses one of the program configs from the menu and the url changes to: http://host/service/home.html#ABC/config. This causes the module router to display the correct module.

The issue is that when the page refreshes, only the module router is invoked. The page correctly renders the module content, but the menu is gone -- the page router isn't invoked.

What am I doing wrong? How do I fix this?

1

1 Answers

0
votes

Your page router have a route with value "" which doesn't exist when you have a url with abc/config. It would be better if you remove the page router and leave only the module router.

Try doing your application to execute whatever the page router is doing onLoad time and leave only one router.

Creating a header and footer that are all the same on every page isn't job for a router.