From 2953bf76770c6cb88f198c0c186ab3f6f1a166ba Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sun, 7 Sep 2025 13:28:34 +0200 Subject: [PATCH] WIP: Injection funktioniert auch so -- actions weiter undefined! --- src/app/store/login.effects.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/store/login.effects.ts b/src/app/store/login.effects.ts index 7ceb864..bf29516 100644 --- a/src/app/store/login.effects.ts +++ b/src/app/store/login.effects.ts @@ -1,4 +1,4 @@ -import { Injectable } from '@angular/core'; +import { Injectable, inject } from '@angular/core'; import { Actions, createEffect, ofType } from '@ngrx/effects'; import { map, catchError, switchMap } from 'rxjs/operators'; import { of } from 'rxjs'; @@ -7,6 +7,8 @@ import { AuthService } from '../services/auth.service'; @Injectable() export class LoginEffects { + private authService = inject(AuthService); + login$ = createEffect(() => this.actions$.pipe( ofType('[Login] User Login'), @@ -19,5 +21,5 @@ export class LoginEffects { ) ); - constructor(private actions$: Actions, private authService: AuthService) {} + constructor(private actions$: Actions) {} } -- 2.20.1