I am learning the use of Angular Route Resolvers, and from some sources on web, I get idea that those are used to perform actions after the navigation event and before our component is loaded.
But, if I can control the loading of DOM using structural directives like *ngIf
and perform required actions in ngOnInit()
before loading of DOM, then what is the use case of resolvers.
Are they efficient and performance optimizers? Is there specific case where I have no option other than using resolvers?
(I am referring to https://stackblitz.com/edit/angular-route-resolvers as an example).
Resolvers can be useful for many reasons:
Their downsides is that