toSignal() cannot be called from within a reactive context

Discussão em 'Angular' iniciado por 3gwebtrain, Agosto 13, 2025.

  1. 3gwebtrain

    3gwebtrain Guest

    When I subscribe and update the signal getting error as follows. any one pls help me to come out of this issue?

    Error detail:


    ERROR RuntimeError: NG0602: toSignal() cannot be called from within a reactive context.

    Invoking toSignal causes new subscriptions every time. Consider moving toSignal outside of the reactive context and read the signal value where needed.
    ​

    msalInProgressSubscription(): void {
    this.subscription.add(
    this.msalBroadCastService.inProgress$.subscribe((res: string) => {
    if (res === InteractionStatus.None) {
    this.msalInProgressNone$.set(true);//error goes away when i remove
    }
    })
    );
    }

    Continue reading...

Compartilhe esta Página