Questions tagged [angular-resolver]
135 questions
2
votes
2 answers
npm ERR! Cannot read property 'resolve' of undefined
Almost every command I run with "npm" and some with "ng" returns this error.
I am starting with Nativescript and angular and I am very lost here...
Any idea about where these errors could come from?
For example, trying to create a new app with…

Davicillo DC
- 33
- 1
- 1
- 4
2
votes
3 answers
How do I create a resolver with multiple requests dependent on data from a prior request?
I have a component which retrieves its business object from a single HTTP request, and then has several subsequent requests to populate drop-down lists. The arguments in those subsequent requests consist of data from the business object, so those…

Jacob Stamm
- 1,660
- 1
- 29
- 53
2
votes
2 answers
Refreshing the current route redirects to parent route instead in Angular 5
I have Angular 5 routs configured as follows:
{path: 'malls', component: MallsComponent},
{
path: 'malls/new', component: MallEditComponent,
resolve: {body: MallResolve}
},
{
path: 'malls/:id', component: MallEditComponent,
…

Alexander Yakovlev
- 305
- 1
- 2
- 5
2
votes
1 answer
Chain observables to load dependent datas
I'm loading an employee in my resolver. This employee returns a list of town's ids.
I want to load all the towns from this town's id list in the same resolver. But I don't want to return the list of town, I want to return the employee.
The loaded…

Ben
- 3,972
- 8
- 43
- 82
2
votes
0 answers
Ngrx and resolvers with HttpClient in Angular 6
I'm using ngrx / (store, effects) in Angular 6.
I have the problem in the resolution of one of the routing variables by a resolver.
Here the code and the explanation
Resolver
@Injectable()
export class HkSpecialitiesResolver implements…

Cristian Rinaldi
- 329
- 4
- 15
2
votes
2 answers
Angular resolver is not working. Route never subscribes to the observable returned
I am trying to add a resolver to a route of my angular application.
Following is the resolver.
@Injectable()
export class ItemsResolver implements Resolve- {
constructor(private itemService: ItemsService) {
}
resolve(route:…

Lahiru Chandima
- 22,324
- 22
- 103
- 179
2
votes
1 answer
Angular 4 - use resolver for app component
I have just discovered the resolver class, and find it very useful.
There are different objects I need to preload, depending on specific url.
However, in my layout (app.component.ts + app.component.html) I would like to use resolver in order to…

guyaloni
- 4,972
- 5
- 52
- 92
1
vote
2 answers
How to proper implement an Angular Resolver using NGRX
I have been playing around with NGRX for the couple last days.
I'm following an Udemy course, and at some point in the course the teacher makes a resolver to prefetch some data into the ngrx store only in the first time we enter a given…

Bruno Miguel
- 1,003
- 3
- 13
- 26
1
vote
1 answer
Load data before component renders Angular
I am trying to load the data for places before the component renders.
dashboard.html
{{ places[0]._id }} //just for testing
dashboard.ts
import { Component, OnInit } from '@angular/core';
import { PlacesService } from…

aron bleier
- 91
- 5
1
vote
0 answers
"Unable to resolve dependency tree" while creating a new Angular project
I am new to coding, and I want to start using Angular on my M1 MacBook.
The installation of Angular cli was only somewhat successful, as I got this warning after typing sudo npm install -g @angular/cli:
npm WARN deprecated @npmcli/move-file@2.0.1:…

Carl Emil Zeidler
- 11
- 1
1
vote
1 answer
Angular Router not Resolving Promises before returning observable
I have a resolver which uses the url to fetch the parent called a bubble, for the reply that I then want to fetch based on the URL.
Problem is that my findReplyByUrl() function wont wait for the DOCID that I am trying to resolve. The resolver…

nuccio
- 316
- 6
- 17
1
vote
0 answers
Angular 12: Resolve guard redirects to its current component instead of navigating to its destination
When you log in you should be redirected to the dashboard page. When we navigate to the dashboard we are going to do a resolve so that the data is already loaded even before we can see the page. When we go directlry to the link of the dashboard I am…

Gilles
- 11
- 1
1
vote
1 answer
Angular: routing resolver placement
Does it matter where the resolver exists in Angular in these two examples? Both of these two snippets of code achieve the same result:
Placing the resolver at the module-level within AppModule:
const routes: Routes = [
{
path: 'user',
…

keldar
- 6,152
- 10
- 52
- 82
1
vote
1 answer
how to spy on Rxjs operators like 'take'
@Injectable({
providedIn: 'root'
})
export class MyResolver implements Resolve {
constructor(private readonly _store: Store) {}
resolve(
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot
):…

Richard77
- 20,343
- 46
- 150
- 252
1
vote
0 answers
Angular resolver nested object value undefined
I have a resolver that seems to "lose" data when I'm using it.
The resolver's task would be to get the download url for the banner and thumbnail (if there was one) for the given stack as if there was one. My goal with that is to only show the…

Balu
- 398
- 6
- 15