Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

99
Views
Ngrx and Angular Resolver

im having a problem with ngrx and my resolver in angular. I know the problem but i don't find a solution for it. I am selecting an account from my ngrx store and end the obs with the take(1), but because of the take(1) it always takes the first value so when i emit a new value the resolver doesnt get it. Can someone help me?

resolve(route: ActivatedRouteSnapshot): Observable<Account> {
    const id = this.getParameter(route, 'accountId');

    if (id) {
      this._store.dispatch(AccountsPageActions.loadAccountWithDetails({ accountId: id }));
      return this._store.select(getAccountDetailById(id)).pipe(
        switchMap(account => this._store.select(getAccountError).pipe(
          map(error => {
            if (error instanceof HttpErrorResponse && error.message.includes(id)) {
              this._utilService.showErrorToast('Zugang nicht gefunden');
              this._router.navigateByUrl('/');
            }
            console.log(account);
            return account
          })
        )),
        skipWhile(account => account?.id !== id),
        take(1)
      );
    }

    return null;
  }

Edit: The problem is i trigger the resolver in the same route. Example: I am opening an accordion item --> redirect to /account/{accountId1} and if i then open another accordion item i need to redirect to /account/{accountId2} but the resolver doesnt resolve because it doesnt get a new value with the new account.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The resolver was not my problem..

Had a problem with the angular material mat-tab-accordion

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!