Questions tagged [angular-resolver]
135 questions
0
votes
2 answers
How to load html page after promise is resolved?
I am trying to display some data to html component from an ASP .NET Core API using Angular and Typescript, the response are returning correct values and the promise work well.
The problem is the html page loads before the promise is resolved, so the…

Eduard
- 83
- 6
0
votes
1 answer
Where to use angular resolve? Inside lazy loading module's routes or in the parent module's routes?
Let's say we are lazy loading module B from module A. For example:
// routes for module A
const routes: Routes = [
{ path: '', loadChildren: './pages/B/B.module#BModule'}
]
// routes for module B
const routes: Routes = [
{ path: '',…

Arda Oğul Üçpınar
- 881
- 1
- 14
- 38
0
votes
1 answer
Create a Routes path that loads a specific component based on condition
I want to load distinct components for similar structured paths.
Means:
example.com/whatever-post-slug --> Load Post Component
example.com/whatever-page-slug --> Load Page Component
example.com/hello-i-am-a-string --> Load Post Component…

Álvaro Franz
- 699
- 9
- 26
0
votes
1 answer
Invoke modal inside SwitchMap in angular2 resolver
I have a requirement of displaying modal popup based on warning message inside angular resolver. I am making a service call to API and using combineLatest and SwitchMap returning multiple responses. I need to display modal popup based on API service…

Viswa
- 745
- 10
- 30
0
votes
0 answers
Angular 2 resolver causes infinite loop when using redirection inside resolver
I have the following resolver that calls an api service. based on the result I get back I want to redirect the user to specific screen:
@Injectable()
export class TenantStatusResolver implements Resolve {
tenantStatus: OnboardStatusEnum =…

pantonis
- 5,601
- 12
- 58
- 115
0
votes
0 answers
Angular : How to always reload a URL but ignore fragments ? (with RunGuardsAndResolvers ?)
I 'always' want to reload my resolver and only ignoring the reload when a fragment is set (ex: URL/xxx?yyy#FRAGMENTHERE)
Am I missing something or is it not possible in Angular ?
Here is what I tried :
in…

bmtheo
- 974
- 1
- 7
- 16
0
votes
2 answers
Route resolver angular check if data is empty
I have a resolver like this:
export class TaskResolver implements Resolve {
constructor(private taskService: TaskService) { }
resolve(route: ActivatedRouteSnapshot): Observable {
const taskId = route.params.taskId;
…

Miomir Dancevic
- 6,726
- 15
- 74
- 142
0
votes
1 answer
What's the problem in that Angular 7 rxjs subscription from a resolver
I wrote a short code to try routes resolver and subscriptions in component. Here is the route configuration :
{
path: '',
component: EventsComponent,
resolve: {
events: EventsResolverService
}
},
...
Resolver simply…

Jean-Luc Aubert
- 620
- 5
- 19
0
votes
1 answer
Angular show loading animation when resolving FIRST component
I implemented a loading animation that shows a spinner reacting on Angular's router events (NavigationStart, NavigationEnd) which works good. But the first component that is initially called and which may have a resolver that fetchs data from an API…
user4470482
0
votes
1 answer
ngOnInit is calling before resolver data is ready
I have a resolve that is calling getSchools() from service
resolver.ts
export abstract class APIResolverService implements Resolve {
constructor(readonly dropdownService:DropDownOptionsService,readonly route:ActivatedRoute) { }
…

jack
- 181
- 3
- 11
0
votes
1 answer
Angular - Get nested results with 2 different http get methods, last one uses first one data
Inside one resolver I need to get user data. First I need to check if its profile is 'Sales' if yes, using the username returned I have to get the salesPerson data from other http get method, or else, returns some data I can check if is empty.
I…

Heber Paes Fomin
- 85
- 1
- 11
0
votes
0 answers
Problem Reloading Child Routes with Resolve in Angular
I have problems reloading the childComponent functions. I have a component that makes a query to a database depending on a parameter received.
When I access this route for the first time, it executes the OnInit function well, but if I change the…

tw3R
- 68
- 8
0
votes
1 answer
Retrieving data with a resolver in Angular 6 but in the objects the arrays are null. Why?
I have a path 'user/edit' to edit to current logged in user. I have an tab that i want to edit an array of 'Recipe'-s that every user has. I am getting the data about the user with a resolver. And i am getting all his Recipes. The problem is that…

Javorov1103
- 119
- 1
- 9
0
votes
1 answer
How to resolve angularfire2 data in route?
Trying to resolve some data from angularfire2 in my router. When I pass it return of('Hello Alligator!') my component logs Hello Alligator but when I try and resolve the data from the angularfire service it just hangs and never resolves. I'd also…

Justin Young
- 2,393
- 3
- 36
- 62
0
votes
1 answer
Angular How to implement nested resolvers
I have a component that gets a category like so using a resolver:
ngOnInit() {
this.category = this.route.snapshot.data['category'];
}
So this works lovely and gets me category, which is essentially a list of users.
I've manually got the user…

Tom O'Brien
- 1,741
- 9
- 45
- 73