E
E
eRKa2021-10-10 22:38:52
Angular
eRKa, 2021-10-10 22:38:52

Why does routing update the entire page and not just the component?

Actually the problem is described in the question. There is a side menu in which routes to components are specified through routLink. Logically, everything works correctly. But instead of updating only the central part, the entire page is updated completely, due to which the title blinks and the menu collapses when clicked, all requests to the server go again. In other applications with which I worked on Angular, I did not notice this.
A search in the open spaces did not help, maybe someone from experience has options for explaining this behavior. Maybe there are some special poorly documented settings or features of setting modules. In general, any ideas are welcome. And yes, checked 100 times, navigation goes through the [routerLink] property, not href.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sleeper_king_of_bones, 2021-10-15
@Sleeper_king_of_bones

Maybe it's in . [routerLink] can only work within some router-outlet, if you have it duplicated in each component, then this is not correct. In order for the page not to blink, it must be 1 in some common component. Angular.io - https://angular.io/api/router/RouterOutlet If that doesn't help, try providing your html for these components. <router-outlet>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question