0

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.

1

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

2 Comments

Ok we will put some state on a shared angular service and pre-fetch the data in the guard already which is then eventually used in the resolver if it is allowed...
Agree we can use shared service as well

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.