145 questions
2 votes
2 answers
224 views
How to use an Angular Route Title Resolver to wait on an observable?
I have an Angular 19 app and I am trying to add a route title resolver that gets the page title by looking up some data in the results of an Observable. The issue is that when the app first loads, the ...
2 votes
1 answer
70 views
How does the Angular resolver handle subscriptions?
I am using an Angular resolver to load initial Data of my page. As known it is possible to either return an observable or a promise. In my case I have this: export class MySiteResolver implements ...
1 vote
0 answers
57 views
"At least one route resolver didn't emit any value" Navigation error on parent route resolver (Angular)
I have an inconsistent navigation issue when authenticating on my website. On authentication from the login page, there is a navigation to the home page (auth only). On occasion, the navigation fail, ...
1 vote
1 answer
86 views
Facing Angular resolver error after fixing "Cannot Get" problem
Not a long ago I've deployed my project. Only after deploying I realized that I have this "Cannot GET" problem when refreshing my page: Cannot GET / on page refresh with express I've fixed ...
1 vote
0 answers
155 views
Angular: Guard after resolved data
I'm having a route /invoices/:invoiceId for an invoice detail view which needs to be protected with 2 conditions User needs to be authenticated --> Redirect to login page Invoice with given id ...
1 vote
1 answer
98 views
Angular resolvers that return observables, only wait for the first value
Before all my components are rendered, my app needs some basic data that has to be available to all components. Therefore I wrote a resolver that returns an observable. export const appRoutes: Route[] ...
0 votes
0 answers
69 views
How to apply declarative RXJS in Angular for route resolvers
I'm interested in adapting the following code for route resolvers. private categorySubject = new Subject<number>(); categorySelectedAction$ = this.categorySubject.asObservable(); ...
1 vote
1 answer
631 views
Angular 17 Functional Resolver Unable to Inject Services Into Jest Test Case
Overview Hi there, I am in the process of migrating my Angular app from v14 to v17, and one of the tasks that comes with this is replacing the old deprecated Resolver classes with the new ResolverFn ...
2 votes
1 answer
487 views
How to handle stored query params in angular route using resolvers to avoid any extra navigation?
I have this scenario: I am saving the query params in a service in order to keep alive this data if the user close the browser, using the resolvers I am using the result from the active route to add ...
1 vote
1 answer
145 views
Prevent resolver from making additional calls if another resolver called and then redirected to different path
My app tries to auto-redirect user from '/' to correct other path. To do that we need to make a request for some data and only then decide where to redirect the user. The options are just a few, and ...
0 votes
2 answers
336 views
Can a resolver use the same service instance form another module except the AppModule in Angular?
I have a lazy loaded module with all it components declared and routes added in RouterModule.forChild() but some of these routes have their resolver that will prefetch some data And call a service to ...
-1 votes
1 answer
734 views
Angular 16 Resolvers - How to handle redirection to child
I'm just really looking for some general advice on best practice here as it's the first time I've had to use resolvers. So the current flow of my application... App initialisation function to check ...
1 vote
2 answers
1k views
How do I run a http request using a functional resolver?
In the past I can use a class based resolver where I can inject HttpClient in the constructor, but that's been deprecated Source. I'd like to make an HTTP get request in a functional resolver. How do ...
4 votes
1 answer
4k views
Angular ResolveFn - inject() must be called from an injection context
While attempting to deprecate instances of Angular's "Resolve" class implementation for the preferred functional implementation "ResolveFn", I ran into a perplexing issue. I have a ...
0 votes
0 answers
3k views
How to convert deprecated resolver using Resolve interface to use the ResolveFn syntax?
[SOLVED] Original : export enum RecipeActions { SET_RECIPES = '[RECIPES] SET_RECIPES', FETCH_RECIPES = '[RECIPES] SET_RECIPES', // MISSED THIS ADD_SINGLE = '[RECIPES] ADD_SINGLE', ADD_MULTI = '...