I use the isNavigating property of the router to show a spinner when the page is loading. This works fine on the top level router, because the app.html loads, then the spinner shows.
When using a child router, I want the view to show for the viewmodel that owns the child router while it is activating its routed viewmodel. But it won’t show, because the top level router isNavigating property is still true.
Eg, given a hierarchy of App > Parent > Child.
This is what happens:
- App view displays
- App router isNavigating is true, spinner shown instead of app router-view
- Parent viewmodel activated
- App router isNavigating still true
- Child viewmodel activated
- App router isNavigating now false, so router-view displayed with parent > child
I would like:
- App view displays
- App router isNavigating is true, spinner shown instead of app router-view
- Parent viewmodel activated
- App router isNavigating now false, so parent view shown in app router-view
- Parent router isNavigating is true, spinner shown instead of parent router-view
- Child viewmodel activated
- Parent router isNavigating now false, so child view shown in parent router-view
Is there any way to make this work?