Questions tagged [angular-resolver]
135 questions
0
votes
1 answer
Getting data for route resolver by making http requests such that the result of second one depends on the result of first one
I have a resolver in my routing module
{
path: 'path1',
component: FirstComponent,
resolve: {
allOrders: DataResolver
}
}
And then in my resolve function there is
resolve(): Observable> {
return…

tritims
- 52
- 1
- 6
0
votes
0 answers
Angular resolver, object not ready in component
I'm doing a resolver before accessing my component, like this :
return this.unitService.getRoomsByUnitId(unitId)
.map(rooms => {
rooms.map((room: Room) => {
room.beds.map(bed => {
bed.events = new…

Helene
- 421
- 3
- 9
- 18
0
votes
1 answer
Active Route Resolver Returns Undefined On Every Call
I've been working on getting a resolver working on for an activated route. The problem I'm running into is that in my route's component the data I'm trying to get from the resolver is always undefined. I know my service works (I've returned values…

hlatimer
- 73
- 1
- 9
0
votes
2 answers
how to redirect to error component when service give error?
Could you please tell me how to redirect to component when service give error ?In my app I am requesting a service , I want if I got any error some service it will show error component
Here is my…

user944513
- 12,247
- 49
- 168
- 318
0
votes
1 answer
angular router resolver - get params from parent on reload
I have a route like this, with a resolver for a child route.
{
path: 'organizations/:oid',
component: AdminOrganizationComponent,
children: [
{
path: 'profile',
component:…

Han Che
- 8,239
- 19
- 70
- 116
0
votes
2 answers
How to push data between routes in Angular
Assume I am given an item-list array in route /items/. The item-list.component.html looks something like this:
....
View Item
What I'm trying to do is push the…
Moshe
- 2,583
- 4
- 27
- 70
0
votes
4 answers
Angular Load Async data before component initialization
I have a problem to use data from API Calls: I want to use the retrieved data to set checked in a checkbox, but the component is initialized before the api response and I get some console error:
ERROR TypeError: Cannot read property 'id' of…

ufollettu
- 822
- 3
- 19
- 45
0
votes
2 answers
Angular 5/6 Resolver and Observable
I'm literally going crazy trying to use a Resolver in Angular 6.
My Resolver, working version:
@Injectable()
export class MyResolver implements Resolve {
constructor() {
}
resolve(route: ActivatedRouteSnapshot, state:…

Matteo Mosca
- 7,380
- 4
- 44
- 80
0
votes
1 answer
Angular 5 - Resolver should start resolving after initial API response is received
I have situation where a resolver should start resolving only once a configuration API response is received.
Initially, a configuration API is called from app.component.ts. This response is saved in localstorage. The resolver needs to get the…

sadiqmc
- 171
- 2
- 15
0
votes
0 answers
Angular Route Resolve only for distinct values
I have the following Route Config:
{
path: ':id',
component: MyComponent,
resolve: {
data: MyResolver
}
}
The Resolver will simply do an HTTP call to fetch some data:
resolve(route: ActivatedRouteSnapshot, state:…

Benjamin M
- 23,599
- 32
- 121
- 201
0
votes
1 answer
Angular 4 handle with complex data
I have three classes A, B and C like this:
class A{
id: number;
name: string;
//... more
items: B[];
}
class B{
id: number;
name: string;
//... more
otherItems: C[];
}
class C{
id: number;
name: string;
}
A, B and…

Polo
- 35
- 7
-1
votes
1 answer
How to use forkJoin and mergeMap in Angular resolver to chain HTTP requests?
I am building a resolver that is used when my app loads initially. I need to run several HTTP requests, which can be run at the same time (hence using forkJoin). But there are a few that need to be chained once the forkJoin is completed. What would…

ts1993
- 107
- 2
- 12
-1
votes
2 answers
how can i pass queryparams to my resolver
here is my ngOnInit in my component -
ngOnInit() {
this.route.queryParams.subscribe(
(params) => {
console.log(params);
}
)
}
here is my resolver -
class ProductsResolver implements Resolve<
…

blablalbla3233
- 35
- 7
-1
votes
2 answers
Angular Resolver Service Not Working Properly
RoleList Component:::
import { Global } from "./../../../global/serverlinks";
import { Component, OnInit, ViewChild } from "@angular/core";
import { HttpClient } from "@angular/common/http";
import { Observable } from "rxjs";
import {…

Basu Dev Adhikari
- 104
- 7
-1
votes
1 answer
do I need to create different resolvers for each page. each page have different API calls. angular 2+
I do have multiple pages, each page has different API calls. then do I need to create different resolvers for each page?
can I implement resolve to the main service without adding new service?
I wrote resole service like this
resolve(route:…

linto johny
- 137
- 1
- 2
- 9