Child router "isNavigating"

#1

My site relies on 2 to 3 levels of child routers at almost all times. I have a loading indicator which is bound to the main router.isNavigating property and that seems to work, unfortunately it doesn’t seem to ever change for the child routes. What do I need to do?

1 Like
#2

From what you said, is it correct to say isNavigating wasn’t change when your child routes got changed?

#3

Yes, that is exactly what I meant. I was just about to come on here and remove my post. It magically is doing as it should… I changed zero code (I Swear)

1 Like
#4

Actually the issue is with Firefox, I have 2 properties being tested to show my loading indicator which is just nprogress. One is router.isNavigating and the other is httpClient.isRequesting. In chrome, everything works as expected, but in firefox, the isNavigating only seems to trigger once.

#5

I also have a global spinner for slow route/subroute, I cannot reproduce your issue on Firefox. Are you able to create a small demo project to reproduce it?

You can simulate a slow route by adding delay to a route.

activate() {
  return new Promise(resolve => {
    setTimeout(resolve, 3000);
  });
}
1 Like
#6

Unfortunately there is no way for me to recreate my project quickly. I will intentionally delay activate like you did just to see if maybe the activate methods are happening faster in firefox.

1 Like
#7

So when there is a a promise in the activate with a timeout, i do see the indicator in firefox. Firefox must be faster at handling the pipeline?

1 Like
#8

From what you described, it is likely just took fast.

2 Likes