stephan.peters
stephan.peters

Reputation: 1107

Angular resolver cancelling loading route component

I have an Angular resolver which is fetching data from an external system through a http call. Based on some condition I don't want the resolver to proceed and loading the component in the route. How can we manage this in Angular without using CanActivate. The reason is that I want to fetch this data only once for performance reasons.

Upvotes: 0

Views: 61

Answers (1)

Srinivasan Sekar
Srinivasan Sekar

Reputation: 2119

Use LocalStorage or SessionStorage or SharedService, set a flag to decide whether to route to the component or not.

Upvotes: 1

Related Questions