Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

102
Vistas
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 Respuestas
Responde la pregunta

0

The resolver was not my problem..

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

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda